`
myrl1023
  • 浏览: 35136 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

struts1.2有多个config和多个contextConfigLocation在web.xml中如何设置

阅读更多
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>





分享到:
评论

相关推荐

    JAVA web.xml配置详解

    &lt;param-value&gt;/WEB-INF/spring-config.xml &lt;!-- 备注:此所设定的参数,在JSP网页中可以使用下列方法来取得:${initParam.param_name} 若在Servlet可以使用下列方法来获得:String param_name=getServletContext...

    web.xml中如何设置配置文件的加载路径实例详解

    web.xml中如何设置配置文件的加载路径实例详解 web应用程序通过Tomcat等容器启动时,会首先加载web.xml文件,通常我们工程中的各种配置文件,如日志、数据库、spring的文件等都在此时被加载,下面是两种常用的配置...

    ssh框架在application.xml中配置数据源所需jar

    - dataAccessContext-local/jta.xml (see web.xml's "contextConfigLocation"). --&gt; &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...

    MyContextLoaderPlugIn.jar

    和Spring中OpenSessionInView由于org.springframework.web.struts.ContextLoaderPlugIn中保存同一个对象的名不同导致openSessionInView失效 稍微修改后在struts-config.xml中使用MyContextLoaderPlugIn.jar包中...

    企业人力资源管理项目SSH+EXT+MySQL+MD5

    在web.xml的display-name标签与welcome-file-list标签中加入一下代码 struts2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter struts2 /* org.springframework.web.context....

    spring和hibernate整合

    在web.Xml中 &lt;param-name&gt;contextConfigLocation &lt;param-value&gt;/WEB-INF/spring/*.bean.xml org.springframework.web.context.ContextLoaderListener &lt;listener&gt; &lt;listener-class&gt;org.spring...

    基于java的企业级应用开发:Spring MVC的核心类和注解.ppt

    * * * * Spring MVC的核心类和注解 请输入您的部门/机构名称 12.1 DispatcherServlet DispatcherServlet的全名是org.springframework.web.servlet.DispatcherServlet,它在程序中充当着前端控制器的角色。...

    基于java的企业级应用开发:Spring的核心容器.ppt

    Web服务器实例化ApplicationContext容器时,通常会使用ContextLoaderListener来实现,此种方式只需要在web.xml中添加如下代码: &lt;context-param&gt; &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; &lt;param-value&gt; ...

    ssh(structs,spring,hibernate)框架中的上传下载

    CONTENT表字段上,在Spring中采用OracleLobHandler来处理Lob字段(包括Clob和Blob),由于在程序中不需要引用到oracle数据驱动程序的具体类且屏蔽了不同数据库处理Lob字段方法上的差别,从而撤除程序在多数据库移植...

    springweb3.0MVC注解(附实例)

    web.xml 中定义了一个名为 annomvc 的 Spring MVC 模块,按照 Spring MVC 的契约,需要在 WEB-INF/annomvc-servlet.xml 配置文件中定义 Spring MVC 模块的具体配置。annomvc-servlet.xml 的配置内容如下所示: &lt;?xml...

    Spring MVC Demo

    本工程主要是一个练手,里面对web.xml和applicationContext-base.xml有一个详细的说明。 &lt;servlet&gt; &lt;servlet-name&gt;Dispatcher &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet &lt;!--...

    spring-simple-web:使用 Spring Framework 的简单 Web (WAR) 项目

    这个简单的例子演示了在 web 应用程序中使用的 Spring 容器,即org.springframework.web.context.WebApplicationContext Web 应用程序使用 Spring Web 侦听器初始化,例如web.xml org.springframework.web.context...

    SSH第7章上机.zip ACCP8.0

    在web.xml中配置struts &lt;filter-name&gt;struts2 &lt;filter-class&gt;org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter &lt;filter-name&gt;struts2 &lt;url-pattern&gt;/* 在web.xml配置spring &lt;!-- ...

    一个简单的Acegi入门实例

    &lt;!!-- web.xml文件 --&gt; &lt;?xml version="1.0" encoding="UTF-8"?...&lt;param-value&gt;/WEB-INF/acegi-config.xml&lt;/param-value&gt; &lt;/context-param&gt; &lt;!-- Acegi 的 Filter Chain 代理 --&gt; &lt;filter&gt; &lt;filter-name&gt;

    Spring MVC 入门实例

    上面, 我们在 web.xml 文件中告诉 ContextLoaderListener, 我们还有另外两个配置文件 /WEB-INF/database.xml 和 /WEB-INF/applicationContext.xml. applicationContext.xml: 1 &lt;?xml version="1.0" encoding=...

    CXF WebService整合Spring示例工程代码demo

    2.web工程的web.xml中配置CXFServlet &lt;!-- 设置Spring容器加载配置文件路径 --&gt; &lt;param-name&gt;contextConfigLocation &lt;param-value&gt;classpath*:applicationContext-server.xml &lt;listener-class&gt;org....

    基于EXT SSI的简单树实现

    它进入web.xml,发现自己需要经历struts2这个过滤器,于是在这个过滤器里,应用把工作交给了struts,在struts配置中找到getDesc这个控制器, &lt;result name="xmlMessage" type="plaintext"&gt; 在struts内部,这...

    springmybatis

    查询出列表,也就是返回list, 在我们这个例子中也就是 List&lt;User&gt; , 这种方式返回数据,需要在User.xml 里面配置返回的类型 resultMap, 注意不是 resultType, 而这个resultMap 所对应的应该是我们自己配置的 ...

    ssh框架的搭建

    /WEB-INF/applicationContext-*.xml,/WEB-INF/action-servlet.xml &lt;param-name&gt;log4jConfigLocation &lt;param-value&gt;/WEB-INF/log4j.properties &lt;!-- Listener contextConfigLocation --&gt; ...

    生活轨迹SSH服务端

    &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=...

Global site tag (gtag.js) - Google Analytics