struts2中,action之间传递参数的问题

我现在需要把一个action(action1)中的变量传递到另外的一个action(action2)中,两个action中都定义了属性
String userId,User user,并且定义了相应的getter,setter方法,在struts.xml中配置如下:


Action2
/
${user}
${userId}
test

/index_notLogin.jsp

执行时,action2成功调用,但是里面的变量(userId,user)全为null。
为什么?

有帖子说,把type换成“chain”,我换了,还是null。
[b]问题补充:[/b]
blareck:
我的两个action中有同名的参数,并且有getter,setter,为什么还是null?

result name="toLiginIndex" type="chain" > Action2

这样就可以了

[color=red]Action2[/color]
action2是不是你配置错了,

这是我的配置
[code="java"]
ActionSecond



/test.jsp

[/code]
注意:ActionFirst中与ActionSecond中必须要有名称相同的参数的getter和setter方法!
比如在ActionFirst中设置了一个
[code="java"]private String test[/code]
那么ActionSecond也应该有一个
[code="java"]private String test[/code]
并且有getter和setter方法!

楼主Debug看看参数有没有传传过去啊!

我不是在struts的配置文件中用标签传值,而是直接页面form表单提交的!

另:换用版本低一点的struts试试,如果你用的2.1.x的就用2.0.x的版本来试试!

感觉struts2最新的几个版本有不小的bug!