Spring整合Struts2(一)
来源:互联网 发布:淘宝新开店铺有扶持吗 编辑:程序博客网 时间:2024/06/09 16:15
1、所需jar包:
2、项目结构图
3、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" 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>Struts2Spring1</display-name> <welcome-file-list> <welcome-file>register.jsp</welcome-file> </welcome-file-list> <!-- 用来定位spring配置文件 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param> <!-- 监听器 --> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <!-- struts配置 --> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.FilterDispatcher</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping></web-app>
4、applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.5.xsdhttp://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop-2.5.xsdhttp://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx-2.5.xsd"><bean id="reg" class="com.lzm.action.RegAction" scope="prototype"/></beans>
5、struts.xml
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE struts PUBLIC"-//Apache SoftWare Foundation//DTD Struts Configuration 2.0//EN""http://struts.apache.org/dtds/struts-2.0.dtd"><struts><package name="reg" extends="struts-default"><action name="reg" class="reg"><result name="success">/regsuccess.jsp</result><result name="input">/register.jsp</result></action></package></struts>
- Spring整合Struts2(一)
- spring+struts2整合(一)
- spring整合struts2方案(一)
- Struts2+Hibernate+Spring整合(一)
- java综合(一)spring与struts2整合
- ssh框架整合:struts2+hibernate+spring(一)
- Spring+Hibernate+Struts2整合笔记一
- Struts2+Spring 整合成功测试案例(一)
- SSH整合(三)- Spring整合Struts2
- spring_day4_03-ssh整合(struts2整合spring)
- spring/struts2 整合(转载)
- spring+struts2整合(二)
- Struts2+Spring 整合成功测试案例--整合过程中遇到的问题及解决方法(一)
- SSH框架整合(一) —— Spring与Struts2整合
- Spring学习(八)spring整合struts2
- 【Spring】Spring+Struts2+Hibernate3整合(十七)
- Spring -- spring整合struts2
- Spring:Spring整合Struts2
- Linux 下安装配置 JDK7
- 二维数组 蛇形遍历
- 五大常用算法之四:回溯法(转)
- Markdown使用小记
- 联想G500 重新分区,安装Win7小技巧
- Spring整合Struts2(一)
- 如何自动刷新网页
- php如何设置cookie实现自动登陆?
- 监听电话状态,调节音量
- 理解一下 GK Zone 20 与GK Zone 20N的区别
- php怎么实现在登陆界面登陆之后在主页面显示你的登陆个人i信息?
- ogre的动态光照
- 61. 统一二进制
- HDU 2100 Lovekey