• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

html:messages ActionMessages Action

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you do the following in your Action class?

saveMessages(request, messages);

If not, that's the problem.
 
azhar bharat
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this worked fine
saveMessages(request.getSession(), messages);
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The saveMessages() method gives you the choice of putting your messages in either session scope or request scope.
reply
    Bookmark Topic Watch Topic
  • New Topic