| Author |
html:messages ActionMessages Action
|
azhar bharat
Ranch Hand
Joined: Jul 17, 2006
Posts: 87
|
|
I have the following code in my Action: ActionMessages messages=new ActionMessages(); messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("general.message",id)); forward=mapping.findForward("Success"); return forward; And the below code in jsp file to which it is forwarded to: <html:messages id="msg" message="true"> <bean:write name="msg" /> </html:messages> But nothing is displayed. The errors in my actionforms are properly displayed. The problem seems to be with messages from Action class. What is wrong ?
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
Did you do the following in your Action class? saveMessages(request, messages); If not, that's the problem.
|
Merrill
Consultant, Sima Solutions
|
 |
azhar bharat
Ranch Hand
Joined: Jul 17, 2006
Posts: 87
|
|
this worked fine saveMessages(request.getSession(), messages);
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
|
The saveMessages() method gives you the choice of putting your messages in either session scope or request scope.
|
 |
 |
|
|
subject: html:messages ActionMessages Action
|
|
|