struts1.2中有多个struts-config 和多个contextConfigLocation在项目中的web.xml当中是这样做的
<!-- struts设置 -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>com.chinaway.web.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>
/WEB-INF/conf/struts-config.xml,
/WEB-INF/conf/struts-config-agent.xml,
/WEB-INF/conf/struts-config-onlineserve.xml,
/WEB-INF/conf/struts-config-drawing.xml,
/WEB-INF/conf/struts-config-fund.xml,
/WEB-INF/conf/struts-config-question.xml,
/WEB-INF/conf/struts-config-other.xml,
/WEB-INF/conf/struts-config-member.xml,
/WEB-INF/conf/struts-config-sign.xml
</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- applicationContext -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/classes/applicationContext.xml
/WEB-INF/classes/applicationContext_zcdb.xml
/WEB-INF/classes/applicationContext_forecast.xml
/WEB-INF/classes/com/chinaway/applicationContext.xml
/WEB-INF/classes/com/agent/applicationContext.xml
/WEB-INF/classes/com/chess/applicationContext-server.xml
/WEB-INF/classes/com/questionnaire/applicationContext.xml
/WEB-INF/classes/com/other/applicationContext.xml
/WEB-INF/classes/com/member/applicationContext.xml
/WEB-INF/classes/com/sign/applicationContext.xml
/WEB-INF/classes/com/endow/applicationContext.xml
</param-value>
</context-param>
分享到:
相关推荐
<param-value>/WEB-INF/spring-config.xml <!-- 备注:此所设定的参数,在JSP网页中可以使用下列方法来取得:${initParam.param_name} 若在Servlet可以使用下列方法来获得:String param_name=getServletContext...
web.xml中如何设置配置文件的加载路径实例详解 web应用程序通过Tomcat等容器启动时,会首先加载web.xml文件,通常我们工程中的各种配置文件,如日志、数据库、spring的文件等都在此时被加载,下面是两种常用的配置...
- dataAccessContext-local/jta.xml (see web.xml's "contextConfigLocation"). --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...
和Spring中OpenSessionInView由于org.springframework.web.struts.ContextLoaderPlugIn中保存同一个对象的名不同导致openSessionInView失效 稍微修改后在struts-config.xml中使用MyContextLoaderPlugIn.jar包中...
在web.xml的display-name标签与welcome-file-list标签中加入一下代码 struts2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter struts2 /* org.springframework.web.context....
在web.Xml中 <param-name>contextConfigLocation <param-value>/WEB-INF/spring/*.bean.xml org.springframework.web.context.ContextLoaderListener <listener> <listener-class>org.spring...
* * * * Spring MVC的核心类和注解 请输入您的部门/机构名称 12.1 DispatcherServlet DispatcherServlet的全名是org.springframework.web.servlet.DispatcherServlet,它在程序中充当着前端控制器的角色。...
Web服务器实例化ApplicationContext容器时,通常会使用ContextLoaderListener来实现,此种方式只需要在web.xml中添加如下代码: <context-param> <param-name>contextConfigLocation</param-name> <param-value> ...
CONTENT表字段上,在Spring中采用OracleLobHandler来处理Lob字段(包括Clob和Blob),由于在程序中不需要引用到oracle数据驱动程序的具体类且屏蔽了不同数据库处理Lob字段方法上的差别,从而撤除程序在多数据库移植...
web.xml 中定义了一个名为 annomvc 的 Spring MVC 模块,按照 Spring MVC 的契约,需要在 WEB-INF/annomvc-servlet.xml 配置文件中定义 Spring MVC 模块的具体配置。annomvc-servlet.xml 的配置内容如下所示: <?xml...
本工程主要是一个练手,里面对web.xml和applicationContext-base.xml有一个详细的说明。 <servlet> <servlet-name>Dispatcher <servlet-class>org.springframework.web.servlet.DispatcherServlet <!--...
这个简单的例子演示了在 web 应用程序中使用的 Spring 容器,即org.springframework.web.context.WebApplicationContext Web 应用程序使用 Spring Web 侦听器初始化,例如web.xml org.springframework.web.context...
在web.xml中配置struts <filter-name>struts2 <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter <filter-name>struts2 <url-pattern>/* 在web.xml配置spring <!-- ...
<!!-- web.xml文件 --> <?xml version="1.0" encoding="UTF-8"?...<param-value>/WEB-INF/acegi-config.xml</param-value> </context-param> <!-- Acegi 的 Filter Chain 代理 --> <filter> <filter-name>
上面, 我们在 web.xml 文件中告诉 ContextLoaderListener, 我们还有另外两个配置文件 /WEB-INF/database.xml 和 /WEB-INF/applicationContext.xml. applicationContext.xml: 1 <?xml version="1.0" encoding=...
2.web工程的web.xml中配置CXFServlet <!-- 设置Spring容器加载配置文件路径 --> <param-name>contextConfigLocation <param-value>classpath*:applicationContext-server.xml <listener-class>org....
它进入web.xml,发现自己需要经历struts2这个过滤器,于是在这个过滤器里,应用把工作交给了struts,在struts配置中找到getDesc这个控制器, <result name="xmlMessage" type="plaintext"> 在struts内部,这...
查询出列表,也就是返回list, 在我们这个例子中也就是 List<User> , 这种方式返回数据,需要在User.xml 里面配置返回的类型 resultMap, 注意不是 resultType, 而这个resultMap 所对应的应该是我们自己配置的 ...
/WEB-INF/applicationContext-*.xml,/WEB-INF/action-servlet.xml <param-name>log4jConfigLocation <param-value>/WEB-INF/log4j.properties <!-- Listener contextConfigLocation --> ...
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=...