【发布时间】:2012-02-25 02:47:05
【问题描述】:
我想在重定向到不同的操作后保留一个属性值。我知道价值会消失,因为我们正在导航到不同的操作(请求)。但是我需要一些如何实现这一点的方法?
这是我的代码:
<action name="save" class="saveAction" method="saveData">
<result name="success" type="redirectAction">redirectedPageAction</result>
<result name="successView" >successView.jsp</result>
<result name="error" >error.jsp</result>
</action>
<action name="redirectedPageAction" class="month" method="">
<result name="success">employeesList.jsp</result>
</action>
在保存操作类中,我使用 addActionMessage(String msg) 方法设置值。我也有相同的 getter/setter。
我试过了,但没有成功:
<action name="redirectedPageAction" class="month" method="">
<result name="success">employeesList.jsp>
<param name="msg">${msg}</param>
</result>
</action>
我想要在我的 employeelist.jsp 页面中由 adActionMessage(msg) 设置的值。我收到空指针 struts 异常。
请帮忙..
【问题讨论】: