Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using ActionErrors with Exceptions

 
M Burke
Ranch Hand
Posts: 406
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think ActionErrors will be deprecated - and ActionMessages are to be used for displaying errors. Just FYI.

Mallika.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic