struts2和Spring2整合问题

在"struts2学习笔记-Action的配置及基础应用和原理"篇学习笔记中的动态方法调用部分曾经提到过一个安全问题,其原文:

For Struts 2, we added a switch to disable DMI for two reasons. First, DMI can cause security issues if POJO actions are used. Second, DMI overlaps with the Wildcard Method feature that we brought over from Struts 1 (and from Cocoon before that). If you have security concerns, or would like to use the "!" character with Wildcard Method actions, then set struts.enable.DynamicMethodInvocation to FALSE in the application configuration.

昨天在进行struts2和Spring2整合的过程中也发现一个问题,就是当把Struts2的action交给Spring进行管理时,

发现当在Struts2中通过配置逻辑action调用同一个action类中的不同方法时,出现一旦给一个action中的类变量赋值后,在下次调用同一个action中的另外一个方法时,该变量的值仍然存在,action类并没有被重新实例化,后来经过不断的日志分析和测试,发现问题竟然出现在Spring对Action的配置管理上,将Spring中的Action配置改为如下:

<bean id="SysUserAction" class="com.web.actions.SysUserAction" scope="prototype">
		<property name="boSYS_USER" ref="IBoSYS_USER"/>
	</bean>

重新部署运行,K,问题终于解决了,真弱智!只顾着去怪Struts2,居然忘记Spring了,看来以后查问题还得先好好分析确定问题的边界,不能太盲目... 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值