Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Struts and the fly likes Using ActionErrors with Exceptions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Using ActionErrors with Exceptions" Watch "Using ActionErrors with Exceptions" New topic

Using ActionErrors with Exceptions

M Burke
Ranch Hand

Joined: Jun 25, 2004
Posts: 397
I am not sure how to populate the struts ActionError list with messages from Exceptions. When I run this, I get a blank message output.

catch (Exception e){
String _err = e.getMessage();
if(_err == null || _err.compareTo("")== StopConstants.STRINGSEQUAL){
_err = StopConstants.UNKNOWNERROR;

ActionErrors errors = new ActionErrors();
ActionError am = new ActionError(_err);
errors.add(errors.GLOBAL_ERROR, am);
saveErrors(request, errors);

Mallika R Kumar
Ranch Hand

Joined: Jan 21, 2004
Posts: 38
Think ActionErrors will be deprecated - and ActionMessages are to be used for displaying errors. Just FYI.

I agree. Here's the link:
subject: Using ActionErrors with Exceptions
jQuery in Action, 3rd edition