在行动.Test1
公共类 Test1 扩展 ActionSupport {
public String execute() {
addActionMessage("Hello in test2");
return SUCCESS;
} else {
addActionError("Please try again");
return INPUT;
}
}
在 struts.xml 中
<action name="test1" class="action.Test1">
<result name="success" type="redirect">test2</result>
</action>
<action name="test2" class="action.Test2">
<result name="success">/test2.jsp</result>
</action>
我想 显示ActionMessage
和ActionError
test2.jsp