1.1. Spring Integrated STRUTS2
1) The Spring user mobile Web-inf the next
2) Configure the spring configuration file in Web. xml
<!--introduce spring configuration files-- <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext.xml</param-value> </context-param> |
3) Configure spring monitoring in Web. xml
<!--Spring Listener-- <listener> <listener-class>org.springframework.web.context.contextloaderlistener</listener-class > </listener> |
4) Configure the Struts2 action in the spring configuration file
<bean id= "useraction" class= "Com.morris.spring.action.UserAction" > </bean> |
5) Introduction of spring constants in the STRUTS2 configuration file
<constant name= "objectfactory" value= "Spring" ></constant> |
6) Configure the Action,class as the ID value configured in spring in the Struts2 configuration file
<package name= "Default" extends= "Struts-default" namespace= "/" > <action name= "Welcome" class= "useraction " method= "Welcome" > <result>/index.jsp</result> </action> </package> |
Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.
Spring Integrated STRUTS2