Hi I have below pseudo code with throws an exception like this
throw new MyException("Bad thing happened","com.stuff.errorCode");
where MyException extends Exception class. Below is how I am handling the exception
ActionMessages errors = new ActionMessages();
if(ex.getErrorCode() != null && !"".equals(ex.getErrorCode()))
error = new ActionMessage(ex.getErrorCode()); // com.stuff.errorCode is the errorCode
else
error = new ActionMessage(ex.getMessage()); //"Bad thing happened" is error message
errors.add(ActionMessages.GLOBAL_MESSAGE, error);
//errors.add(Globals.MESSAGE_KEY, error );
saveErrors( requ, errors );
return (mapping.findForward(nextScreen));
Now on the user screen the message appears as
???en_US.Bad thing happened???
I am using Struts 1.2.4 and I am looking into the source code of it, but any pointer will be greatly appreciated.