Struts использование ActionMessages
struts-config.xml
...
<action-mappings>
<action path="/login"
type="struts.action.MyAction"
parameter="action"
name="loginForm"
scope="session">
<forward name="success"
path="/jsp/success.jsp"
redirect="true"/>
</action>
</action-mappings>
<message-resources parameter="ApplicationResources"/>
...
MyAction.java
...
public ActionForward loginMethod(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response){
ActionMessages messages = new ActionMessages();
ActionMessage mess = new ActionMessage("her");
messages.add(ActionMessages.GLOBAL_MESSAGE,mess);
saveErrors(request, messages);
return mapping.findForward(SUCCESS);
}
success.jsp
...
<html:html>
<body>
<html:messages id="mess" message="true" />
</body>
</html:html>