所谓SSH,即struts+spring+hibernate的J2EE架构。
1.环境下载:Spring 3.1.1 + Struts 2.3.1.2 + Hibernate 4.1
http://struts.apache.org/download.cgi
http://www.springsource.org/download
http://in.relation.to/Bloggers/HibernateORM412Release
重要配置:
Web.xml
-
<?xml version="1.0" encoding="UTF-8"?>
-
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
- id="WebApp_ID" version="3.0">
- <display-name>Eriloan_com</display-name>
- <session-config>
- <session-timeout>30</session-timeout>
- </session-config>
- <context-param>
- <param-name>contextConfigLocation</param-name>
- <param-value>classpath:/spring-config/applicationContext-*.xml</param-value>
- </context-param>
- <listener>
- <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
- </listener>
- <listener>
- <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
- </listener>
- <listener>
- <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
- </listener>
- <listener>
- <listener-class>org.apache.struts2.dispatcher.ng.listener.StrutsListener</listener-class>
- </listener>
- <filter>
- <filter-name>encodingFilter</filter-name>
- <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
- <init-param>
- <param-name>encoding</param-name>
- <param-value>UTF-8</param-value>
- </init-param>
- <init-param>
- <param-name>forceEncoding</param-name>
- <param-value>true</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>encodingFilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- <filter>
- <filter-name>struts-cleanup</filter-name>
- <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>struts-cleanup</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- <filter>
- <filter-name>struts2</filter-name>
- <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>struts2</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- <filter>
- <filter-name>openSessionInViewFilter</filter-name>
- <filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
- <init-param>
- <param-name>sessionFactoryBeanName</param-name>
- <param-value>sessionFactory</param-value>
- </init-param>
- <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>
- <filter-mapping>
- <filter-name>openSessionInViewFilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
- <welcome-file-list>
- <welcome-file>index.jsp</welcome-file>
- </welcome-file-list>
- <error-page>
- <error-code>404</error-code>
- <location>/WEB-INF/errorPage/404.jsp</location>
- </error-page>
- <error-page>
- <error-code>500</error-code>
- <location>/WEB-INF/errorPage/500.jsp</location>
- </error-page>
-
</web-app>
Spring配置文件(applicationContext-common.xml):
分享到:
相关推荐
SSH环境搭建 初学者可以参考学习,里面命名不规范的请见谅,只是为了面试复习一下........ SSH环境搭建 初学者可以参考学习,里面命名不规范的请见谅,只是为了面试复习一下........ SSH环境搭建 初学者可以参考...
ssh环境搭建及配置示例ssh环境搭建及配置示例
ssh环境搭建
MyEclips集成ssh环境搭建。一些说明和对整个集成过程的DEMO。
ssh环境搭建及简单的增删改查。内含齐全的jar包
这个里面只有一个整合所需要的jar包,搭建ssh环境所需要的
通过mysql数据库,成功搭建 Myeclipse8.5+flex4.5+Blazeds+SSH环境搭建
Myeclipse8.5+flex4.5+Blazeds+SSH环境搭建.pdf
Myeclipse8.5+flex4.5+Blazeds+SSH环境搭建及实例.pdf
网络上好多Myeclipse8.5+flex4.5+Blazeds+SSH环境搭建及实例,个人实验过程中出现了不少问题,通过从网络上搜索各种资源,最后成功整合,以供大家学习。当然,还有部分内容没有修改完,但至少能够成功运行
eclipse下搭建ssh环境,eclipse下搭建ssh环境
eclipse开发工具,spring+hibernate+struts2,注解配置。
NULL 博文链接:https://rico-cai.iteye.com/blog/1966595