struts1和spring结合的笔记
1.web.xml<!--加载spring config--><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><!--加载 struts config--> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.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> 2. struts-config.xml <!--这里用的是继承了org.apache.struts.actions.DispatchAction <action input="/index.jsp" parameter="oper" path="/user" scope="request" type="org.springframework.web.struts.DelegatingActionProxy"> </action> 3. applicationContext.xml <bean name="/user" class="cn.User"></bean>?