Struts2+Spring集成中Action的管理
来源:互联网 发布:图片尺寸修改软件 编辑:程序博客网 时间:2024/05/16 18:43
一般而言我习惯用Struts2的Spring plugin集成,步骤如下:
先在web.xml中加入
先在web.xml中加入
<listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>然后在struts.xml中加入
<constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory" />就可以了。但是我一直有个疑问,spring中bean默认是单例的,但是struts2 action为了多线程安全考虑,肯定不能是单例,应该是每次生成一个新的实例,后来查看StrutsSpringObjectFactory以及相关的代码才发现,如果在struts action的配置文件中<action name=".." class=".."/>中class写的如果是完整的包名和类名的话就是struts创建action对象,如果是spring配置文件中的bean的名字的话就是spring创建,顺序是先从spring中找,找不到再从struts配置文件中找。
- Struts2+Spring集成中Action的管理
- Struts2+Spring集成中Action的管理
- Spring 管理Struts2 Action
- struts2,spring管理action
- struts2,spring整合中使用spring 管理struts2的action,springaop 常见问题
- spring-struts2整合 action的管理
- struts2 spring集成时struts.xml文件中action的class属性值意义
- struts2 spring集成时struts.xml文件中action的class属性值意义
- struts2 spring集成时struts.xml文件中action的class属性值意义
- struts2与spring集成时,关于Action类中成员bean自动注入的问题
- struts2 spring集成时struts.xml文件中action的class属性值意义
- struts2 spring集成时struts.xml文件中action的class属性值意义
- struts2 spring集成时struts.xml文件中action的class属性值意义
- struts2 spring集成时struts.xml文件中action的class属性值意义
- struts2与spring集成时,关于Action类中成员bean自动注入的问题
- struts2 spring集成时struts.xml文件中action的class属性值意义
- struts2与spring集成时,关于Action类中成员bean自动注入的问题
- struts2 spring集成时struts.xml文件中action的class属性值意义
- 经典JavaScript特效
- Intent
- Oralce 函数表达式 的应用
- poj 1157 LITTLE SHOP OF FLOWERS
- WAMP转移至LNMP平台遇到的几个问题及解决方法
- Struts2+Spring集成中Action的管理
- login/getutline.c:25: error: storage class specified for parameter 'buffer'
- 搭建Android开发环境
- 求程序运行所用的时间
- 山洞
- strut2的配置文件修改默认路径问题
- 迷上了这里,迷上了写CSDN博客
- .Net Micro Framework 4.2 QFE1 released
- Linux编译集群 并行编译环境