File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes ActionMessages.GLOBAL_MESSAGE ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ActionMessages.GLOBAL_MESSAGE ??" Watch "ActionMessages.GLOBAL_MESSAGE ??" New topic
Author

ActionMessages.GLOBAL_MESSAGE ??

Maneesh Chauahn
Ranch Hand

Joined: Mar 06, 2006
Posts: 48
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
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ActionMessages.GLOBAL_MESSAGE ??
 
Similar Threads
html:messages ActionMessages Action
how to pass a parameter in resource bundle key
ActionMessages?????????
Checking for an ActionMessage in the JSP
using two properties files in struts