当返回result前对业务对象修改了,但是值栈中对应的对象依然是之前的就值,若想在返回result之前刷新值栈中业务对象各个属性的根对象,需在该action中配置如下参数:
[html] view plaincopyprint?
<action name="studentAction"
class="com.amouse.student.action.StudentAction">
<interceptor-ref name="defaultStack">
<!-- 渲染页面前刷新model在ValueStack的root的引用 -->
[b] <param name="modelDriven.refreshModelBeforeResult">
[u]true [/u]
</param> [/b]
</interceptor-ref>
<result name="main">/pages/student/student.jsp</result>
<result name="login">/pages/student/login.jsp</result>
<result name="success">/pages/student/studentInfo.jsp</result>
</action>
[html] view plaincopyprint?
<action name="studentAction"
class="com.amouse.student.action.StudentAction">
<interceptor-ref name="defaultStack">
<!-- 渲染页面前刷新model在ValueStack的root的引用 -->
[b] <param name="modelDriven.refreshModelBeforeResult">
[u]true [/u]
</param> [/b]
</interceptor-ref>
<result name="main">/pages/student/student.jsp</result>
<result name="login">/pages/student/login.jsp</result>
<result name="success">/pages/student/studentInfo.jsp</result>
</action>