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

怎么在web.xml配置spring,struts2配置以及过滤器

2013-10-21 
如何在web.xml配置spring,struts2配置以及过滤器web.xml我们在整合hibernate.cfg.xml,struts.xml之后,Spri

如何在web.xml配置spring,struts2配置以及过滤器
web.xml     我们在整合hibernate.cfg.xml,struts.xml之后,Spring如何在web.xml配置内,以及当我们出现了懒加载异常后,为了不改变懒加载的模式,那么我们该如何去做?     1.我们配置完spring之后,那么紧接着就是在web.xml中,配置listener了       <listener>            <listener-class>...................ContextLoaderListener</listener-class>       </listener>       <context-param>           <param-name>ContextConfigLoaction</param-name>           <param-value>classpath:application*.xml</param-value>  </context-param>         2.我们配置完struts2之后,那么紧接着就是在web.xml中,配置struts2的过滤器了       <filter>           <filter-name>struts2</filter-name>           <filter-class>....StrutsPrepareAndExecuteFilter</filter-class>       </filter>       <filter-mapping>             <filter-name>struts2</filter-name>             <url-pattern>/*</url-pattern>       </filter-mapping>
     3.当我们遇到懒加载异常的时候,又不像改变它的加载模式的时候,这时候,我们就可以在web.xml中配置        OpenSessionInviewFilter过滤器,来解决这个问题了。      <filter>          <filter-name>OpenSessionInviewFilter</filter-name>          <filter-class>......OpenSessionInviewFilter</filter-class>      </filter>      <filter-mapping>            <filter-name>OpenSessionInviewFilter</filter-name>             <url-pattern>*.action</url-pattern>      </filter-mapping>  

热点排行