spring整合struts配置方式(简要)

来源:互联网 发布:mac有什么好玩的网游 编辑:程序博客网 时间:2024/06/13 21:36

第1种:在struts-config.xml中配置,如下
 以插件的形式集成spring
 <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
  <set-property property="contextConfigLocation" value="classpath:applicationContext.xml" />
 </plug-in>

 

第2种:在web.xml中配置,如下
 <context-param>
  <param-name>
   contextConfigLocation
  </param-name>
  <param-value>
   classpath:applicationContext.xml
  </param-value>
 </context-param>
 <listener>
  <listener-class>
   org.springframework.web.context.ContextLoaderListener
  </listener-class>
 </listener>

 

第三种:在web.xml中配置2,如下
 <context-param>
  <param-name>
   contextConfigLocation
  </param-name>
  <param-value>
   classpath:applicationContext.xml
  </param-value>
 </context-param>

 <servlet>
  <servlet-name>
   SpringContextServlet
  </servlet-name>
  <servlet-class>
   org.springframework.web.context.ContextLoaderServlet
  </servlet-class>
  <load-on-startup>1</load-on-startup>
 </servlet>

 


class "org.apache.commons.collections.ArrayStack"'s signer information does not match signer information of other classes in the same package(错误)

原创粉丝点击