用spring来管理action的方法,把每个action都注入了applicationContext.xml中
在struts-config.xml中action的type用的是org.springframework.web.struts.DelegatingActionProxy类
交给spring来管理
<controller processorClass="org.springframework.web.struts.DelegatingRequestProcessor" />
第一种:
web.xml
第二种:
web.xml
第三种:
用struts-config.xml的
在struts-config.xml中action的type用的是org.springframework.web.struts.DelegatingActionProxy类
交给spring来管理
<controller processorClass="org.springframework.web.struts.DelegatingRequestProcessor" />
第一种:
web.xml
<context-param>
<param-name> contextConfigLocation </param-name>
<param-value> /WEB-INF/applicationContext.xml </param-value>
</context-param>
<servlet-name>SpringContextServlet</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
第二种:
web.xml
<context-param>
<param-name> contextConfigLocation </param-name>
<param-value> /WEB-INF/applicationContext.xml </param-value>
</context-param>
<listener>
<listener-class> org.springframework.web.context.ContextLoaderListener </listener-class>
</listener>
第三种:
用struts-config.xml的
<plug-in className= "org.springframework.web.struts.ContextLoaderPlugIn ">
<set-property property= "contextConfigLocation " value= "/WEB-INF/applicationContext.xml " />
</plug-in>