web.xml 整个配置,用于整合ssh框架
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name></display-name>
<!-- spring配置文件位置 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext-c3p0.xml</param-value>
</context-param>
<!-- openSessionInView配置 -->
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
<init-param>
<param-name>singleSession</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>flushMode</param-name>
<param-value>AUTO</param-value>
</init-param>
</filter>
<!-- Struts2配置 -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>openSessionInViewFilter</filter-name> <!-- 要留意此处的顺序,一定是要在strust2之前进行配置 -->
<url-pattern>*.action</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
<!-- spring监听器 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
相关推荐
NULL 博文链接:https://yanzhenwei.iteye.com/blog/1701164
<set-property property="processorClass" value="org.springframework.web.struts.DelegatingRequestProcessor" /> 3,测试 1,写Action类与Service类 @Controller("testAction") @Scope("prototype...
OpenSessionInViewFilter个人学习总结
Spring MVC Hibernate Demo ...且在web.xml中添加 <filter>openSessionInViewFilter <filter>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter <param>flushMode</param-nam
解决这个问题的方法有两种:一种是在 web.xml 中使用 Spring 提供的 OpenSessionInViewFilter,另一种是在 application.xml 中配置 OpenSessionInViewFilter。前者通用,后者只能用于 SpringMVC 结构中。 最后,...
OpenSessionInViewFilter解决Web应用程序的问题
如:在使用Java中得SSH框架时,我们需要在web.xml文件中配置编码的filter,具体代码是: <span xss=removed><!-- 表单处理乱码,必须在OpenSessionInViewFilter的filter之前 --> <filter>CharacterFilter ...
课程内容 面向接口(抽象)编程的概念与好处 IOC/DI的概念与好处 inversion of control dependency injection AOP的概念与好处 ...opensessionInviewfilter(记住,解决什么问题,怎么解决) Spring JDBC
SSH项目整合示例【OpenSessionInView】所用到的jar包 包含Struts + Hibernate + Spring所有jar及其依赖的jar
OpenSessionInViewFilter OpenSessionInViewInterceptor OpenSessionInViewInterceptor OptimisticLockingFailureException OptionsTag OptionTag OptionWriter OracleLobHandler OracleLobHandler....
struts2.0.8+spring2.0+hibernate3.2 jar包
该案例实现了一个简单的登录功能,但里面将S2SH集成的所有配置信息都添加进去了。 如,OpenSessionInViewFilter、声明式事务、三层等等
Spring4.0、Struts2.3.15、Hibernate4.2.4、jQuery1.9.1涉及到了诸多开发时的细节:ModelDriven、Preparable 拦截器、编写自定义的类型转换器、Struts2 处理 Ajax、OpenSessionInViewFilter、迫切左外连接、Spring ...