spring3-struts2整合
spring 负责对象创建
struts 用Action处理请求
说明:
spring版本:spring-framework-3.2.5.RELEASE
struts版本:struts-2.3.30
- 创建一个JavaWeb的project
- 引入struts2的required的jar包
commons-fileupload-1.3.2.jar
commons-io-2.2.jar
commons-lang3-3.2.jar
freemarker-2.3.22.jar
javassist-3.11.0.GA.jar
ognl-3.0.19.jar
struts2-core-2.3.30.jar
xwork-core-2.3.30.jar
- 引入spring3的required的jar包
commons-logging-1.1.3.jar
spring-beans-3.2.5.RELEASE.jar
spring-context-3.2.5.RELEASE.jar
spring-core-3.2.5.RELEASE.jar
spring-expression-3.2.5.RELEASE.jar
- 引入spring-web支持的jar包
- spring-web-3.2.5.RELEASE.jar [spirng源码包]
- struts2-spring-plugin-2.3.4.1.jar [struts源码包]
- 引入配置文件
- struts.xml [struts路径与action映射配置]
- bean.xml [spring的IOC容器配置]
- web.xml [添加struts2的核心过滤器:StrutsPrepareAndExecuteFilter]
[添加核心监听器,初始化spring的IOC容器:ContextLoaderListener]
<!-- 1.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>/*</url-pattern>
</filter-mapping> <!-- 2.spring配置 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/bean*.xml</param-value>
</context-param> <listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
spring3-struts2整合的更多相关文章
- Struts2,Spring3,Hibernate4整合--SSH框架
Struts2,Spring3,Hibernate4整合--SSH框架(学习中) 一.包的导入 1.Spring包 2.Hibernate 包 3.struts 包 (还欠 struts2-sprin ...
- Spring与Struts2整合VS Spring与Spring MVC整合
Spring与Struts2整合,struts.xml在src目录下 1.在web.xml配置监听器 web.xml <!-- 配置Spring的用于初始化ApplicationContext的 ...
- Spring3+MyBatis3整合log4j无法输出SQL语句问题的解决
今天遇到了跟下面文章一模一样的问题,下面文章的解决方案很好,在这里记录保存一下. Spring3+MyBatis3整合无法输出SQL语句问题的解决
- struts2整合spring的思路
struts2整合spring有有两种策略: >sping容器负责管理控制器Action,并利用依赖注入为控制器注入业务逻辑组件. >利用spring的自动装配,Action将自动会从Sp ...
- struts2整合spring出现的Unable to instantiate Action异常
在struts2整合spring的时候,完全一步步按照官方文档上去做的,最后发现出现 Unable to instantiate Action,网上一搜发现很多人和我一样的问题,配置什么都没有错误,就 ...
- struts2整合json要注意的问题
昨天struts2整合json,一直出错: There is no Action mapped for namespace / and action name ... HTTP Status 404 ...
- struts2整合spring应用实例
我们知道struts1与spring整合是靠org.springframework.web.struts.DelegatingActionProxy来实现的,以下通过具体一个用户登录实现来说明stru ...
- struts2整合JFreechart 饼图、折线图、柱形图
struts2整合JFreechart 饼图.折线图.柱形图 上效果图: 当然可以将数据导出图片格式存储.具体下的链接里的文件有保存成图片的操作. 因为是strust2整合JFreechart,所以s ...
- Spring4笔记12--SSH整合3--Spring与Struts2整合
SSH 框架整合技术: 3. Spring与Struts2整合(对比SpringWeb): Spring 与 Struts2 整合的目的有两个: (1)在 Struts2 的 Action 中,即 V ...
- Spring Struts2 整合
Spring整合Struts2 整合什么?——用IoC容器管理Struts2的Action如何整合?第一步:配置Struts21.加入Struts2的jar包.2.配置web.xml文件.3.加入St ...
随机推荐
- python之路-----前端之js(一)
一.JS发展历史 1992年Nombas开发出C-minus-minus(C--)的嵌入式脚本语言(最初绑定在CEnvi软件中).后将其改名ScriptEase.(客户端执行的语言) Netscape ...
- Oralce数据库的优化
Oralce数据库的优化(面试必问) (1) 选择最有效率的表名顺序(只在基于规则的优化器中有效):ORACLE 的解析器按照从右到左的顺序处理FROM子句中的表名,FROM子句中写在最后的表(基础表 ...
- day47-python爬虫学习二
2.Request的会话对象 s = requests.session() Python2 S = requests.Session() 所有一次会话的信息都保存在s中,只需要对s进行操作就可以了. ...
- Exception、Thorow、Throws、TryCatch
一.异常 概述: 异常指的是不正常,指的是程序中出现了某种问题 java中,所有问题都可以使用一个类来表示,这个类叫做Throwable Throwable: Throwawble是java中所有异常 ...
- JS-构造函数模式代码实战和总结-极客
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Spine用于Timeline(NullReferenceException: Object reference not set to an instance of an object pine.Unity.Editor.AnimationReferenceAssetEditor.OnInspectorGUI ())
报错信息:Spine.Unity.Editor.AnimationReferenceAssetEditor.OnInspectorGUI () (at Assets/Extention/Spine/E ...
- 阻止事件冒泡传播stopPropagation() 阻止自身默认行为preventdefault()
stopPropagation 简单理解:子元素的点击事件 不会去触发父元素的点击事件 preventdefault 简单理解:当点击提交按钮时(submit) 阻止对表 ...
- LINUX 学习笔记 账号与群组的管理
LINUX 账号与群组的管理 UID:UserID 保存文件:/etc/passwd GID:GroupID 保存文件:/etc/group /etc/passwd 文件结构 一行代表一个账号,里面还 ...
- 安装完成IIS后找不到IIS Admin Service
系统版本: Windows Server 2008 R2 Enterprise 64-bit IIS版本:IIS 7.5 问题: 在系统运行里面输入"组件服务",依次点开组件服务- ...
- String、StringBuffer和StringBuilder的区别及应用场景
1. 运行速度:StringBulider>StringBuffer>String String为什么运行行慢呢? String:字符串常量 StringBuffer.StringBuli ...