ssh框架简洁整合过程
2011-12-07 23:50
281 查看
ssh框架整合过程,包含struts1,struts2,hibernate,spring的框架整合过程,整合步骤如下:
0、在web.xml中增加spring配置、struts1、struts2:
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring.xml</param-value>
</context-param>
在web.xml中添加struts1的配置:
<servlet>
<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>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
在web.xml中添加struts2的配置:
<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>*.action</url-pattern>
</filter-mapping>
1、在s1、s2、h3上添加springjar包和struts2-spring-plugin.jar,添加spring配置文件:applicationContext.xml。
2、在applicationContext.xml添加dataSource、sessionFactory、AOP、事务等。
3、在struts-config.xml中增加spring的plugin(struts1):
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property value="classpath:applicationContext.xml" property="contextConfigLocation"/>
</plug-in>
4、修改struts.xml和struts-config.xml中action配置,使用spring统一管理。
type="org.springframework.web.struts.DelegatingActionProxy"
5、消除spring和hibernate的冲突包
6、添加dao、services、biz等包中方法的实现
0、在web.xml中增加spring配置、struts1、struts2:
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring.xml</param-value>
</context-param>
在web.xml中添加struts1的配置:
<servlet>
<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>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
在web.xml中添加struts2的配置:
<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>*.action</url-pattern>
</filter-mapping>
1、在s1、s2、h3上添加springjar包和struts2-spring-plugin.jar,添加spring配置文件:applicationContext.xml。
2、在applicationContext.xml添加dataSource、sessionFactory、AOP、事务等。
3、在struts-config.xml中增加spring的plugin(struts1):
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property value="classpath:applicationContext.xml" property="contextConfigLocation"/>
</plug-in>
4、修改struts.xml和struts-config.xml中action配置,使用spring统一管理。
type="org.springframework.web.struts.DelegatingActionProxy"
5、消除spring和hibernate的冲突包
6、添加dao、services、biz等包中方法的实现
相关文章推荐
- SSH框架搭建过程---之Spring-Hibernate整合(5)
- ssh框架整合hibernate,spring,struts,dwr等技术过程分析
- SSH框架整合过程总结
- SSH框架整合过程总结
- SSH框架整合开发(SSH框架整合过程)
- SSH框架整合过程(Struts2+Spring+Hibernate)
- eclipse下的ssh框架整合过程及测试
- SSH框架搭建过程---之Struts整合Spring框架(4)
- SSH框架整合实现信息管理系统
- maven+spring+springmvc+mybatis+mysql整合过程
- SSH框架整合常见异常错误
- Ubuntu LAMP安装配置 + 整合 JSP 全过程详解
- ssh框架整合
- ssh框架整合实例子-业务层
- SSH框架整合之使用Domain Modelurl取参数值
- SSH框架整合一
- HBase 与Hive数据交互整合过程详解
- CentOS7搭建FastDFS V5.11分布式文件系统及Java整合详细过程(二)
- IDEA用maven整合ssh框架
- ssh框架整合:struts2+hibernate+spring(二):编写domain,dao,service,