首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

struts1跟spring结合的笔记

2012-07-27 
struts1和spring结合的笔记1.web.xml!--加载spring config--context-paramparam-namecontextConfigL

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>
?

热点排行