不知道你是什么架构,
代码的话
ApplicationContext ctx = new ClassPathXmlApplicationContext("conf/appContext.xml");Struts+Spring的话,struts-config.xml中:
<plug-in  className="org.springframework.web.struts.ContextLoaderPlugIn">
  <set-property property="contextConfigLocation" value="WEB-INF/applicationContext.xml" />
</plug-in>