Something like this should work:

MessageResources resources = getResources(request);
String msg = resources.getMessage("message.error");
throw new Exception(msg);

Quoting Barry Volpe <[EMAIL PROTECTED]>:

> Hi,
> 
> Want to expose a message in my action:
> 
> In my action I have:
> throw new Exception("I have an error"); 
> 
> want to use message resource:
> 
> message.error="I have an error"  (in applcation.properties)
> 
> 
> throw new Exception(message.error);   (I know this doesn't work directly)
> 
> 
> Not sure how to set this up.
> 
> Appreciate a code example suggestion.
> 
> Thanks,
> Barry


-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to