• 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

ActionMessages.GLOBAL_MESSAGE ??

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I have a question on the ActionMessages , as this class contains the ActionMesaage class object which is used to show the error message . We put the ActionMessage class in the ActionMessages class
like ActionMessages.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("errorMessage"))

Now my question is that What is the Significance of ActionMessages.GLOBAL_MESSAGE and can i use any String instead of ActionMeassage.GLOBAL_MESSAGE

Thanks in advance for your prompt answer

Regards,
Maneesh Chauhan
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Specifying ActionMessages.GLOBAL_MESSAGE is the standard way of indicating that the message is not attached to a particular input field or property. If you do wish to attach an error message to a property, it is appropriate to specify the property name instead. This name can then be used in either the <html:errors> or <html:messages> tag to show only the message for that particular property. Example:

In your Action class:

In your JSP:

In this case, even if there are other messages present, only the "birthDate" message will be displayed.
 
reply
    Bookmark Topic Watch Topic
  • New Topic