my dog learned polymorphism*
The moose likes Struts and the fly likes ActionMessage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ActionMessage" Watch "ActionMessage" New topic
Author

ActionMessage

jonathan Greens
Ranch Hand

Joined: Apr 07, 2004
Posts: 139
does struts also provide framework for displaying messages similiar to that of displaying errors?
errors.add(ActionErrors.GLOBAL_ERROR,new ActionError(..));
<html:errors/>
Also what is the meaing of ActionErrors.GLOBAL_ERROR, what other keys can I specify here..
thanks in advance!
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
hi

ActionError deosnt mean that u can display only errors with that .u can use it for any messages......to avoid this false assumption they came up with ActionMessages in 1.1 and ActionErrors is deprecated and even removed in 1.2 version of struts

Action messages is like a Hashmap with key as some string and value being the
List of messages u add in that category .that ActionErrors.ERROR_KEY is the constant u r suing to store the errors in thatkey

this key comcept willbe essential if u want to display the error realted to a particlkaur field adjacent to that instead of diaplying all the errors in the page in one shot
jonathan Greens
Ranch Hand

Joined: Apr 07, 2004
Posts: 139
so I can use ActionErrors to display non-error messages?
thanks!
Nathan Hook
Ranch Hand

Joined: Jan 10, 2005
Posts: 81
I actually have a question about this topic.

If ActionErrors are being depricated then why are they still in the validation framework? I don't get it.

It makes it difficult inside of the JSP's to display both action errors and action messages from the examples I've seen.

Can anyone shed some light on this for me?

Regards,

Nate
 
GeeCON Prague 2014
 
subject: ActionMessage