SSH中web.xml文件的配置

Struts:

如果是2.1.3之前的版本,用org.apache.struts2.dispatcher.FilterDispatcher,否则,用org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter。 从Struts2.1.3开始,将废弃ActionContextCleanUp过滤器,而在StrutsPrepareAndExecuteFilter过滤器中包含相应的功能

复制代码
 1 <!-- Struts2 filter -->
 2     <filter>
 3         <filter-name>struts2CleanupFilter</filter-name>
 4         <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
 5     </filter>
 6 
 7     <filter>
 8         <filter-name>struts2Filter</filter-name>
 9         <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
10     </filter>
复制代码

如果程序报类找不到异常,且后面有 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter  等信息,可能是你的版本问题.解决方法是确定你的struts版本, 如果是2.1.3之前的版本,用 org.apache.struts2.dispatcher.FilterDispatcher,以后的版本则配置org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

ActionContextCleanUp的作用:http://blog.csdn.net/xingxing1909/article/details/7843587

复制代码
 1 <filter-mapping>
 2         <filter-name>struts2CleanupFilter</filter-name>
 3         <url-pattern>/*</url-pattern>
 4         <dispatcher>REQUEST</dispatcher>
 5         <dispatcher>FORWARD</dispatcher>
 6     </filter-mapping>
 7 
 8     <filter-mapping>
 9         <filter-name>struts2Filter</filter-name>
10         <url-pattern>/*</url-pattern>
11         <dispatcher>REQUEST</dispatcher>
12         <dispatcher>FORWARD</dispatcher>
13     </filter-mapping>
复制代码

Hibernate:

1 <!-- Hibernate Open Session In View filter -->
2     <filter>
3         <filter-name>hibernateOpenSessionInViewFilter</filter-name>
4         <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
5     </filter>

作用:http://mimimao0901.iteye.com/blog/1388692

Spring:

复制代码
1 <!--Spring ApplicationContext配置文件的路径,可使用通配符,多个路径用,号分隔此参数用于后面的Spring Context 
2         Loader -->
3     <context-param>
4         <param-name>contextConfigLocation</param-name>
5         <param-value>classpath*:/applicationContext.xml</param-value>
6     </context-param>
复制代码
复制代码
 1 <!--Spring的ApplicationContext 载入 -->
 2     <listener>
 3         <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
 4     </listener>
 5 
 6     <!-- Spring 刷新Introspector防止内存泄露 -->
 7     <listener>
 8         <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
 9     </listener>
10 
11     <!-- session超时定义,单位为分钟 -->
12     <session-config>
13         <session-timeout>30</session-timeout>
14     </session-config>
 
 
 
 
转载自:  http://www.cnblogs.com/sunxucool/archive/2012/12/05/2803024.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值