struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Shneyderman" <>
Subject RE: Action Errors?
Date Mon, 30 Jun 2003 16:07:03 GMT

> -----Original Message-----
> From: []
> Sent: Monday, June 30, 2003 9:19 AM
> To:
> Subject: Action Errors?
> Hi,
> Is there anyway to dynamically pass in a Action Error instead of
> having to pass in something from a Resource File (see code below)?

You can use parametrized ActionErrors 
ActionError (mskKey, <list of upto four params>);

This way your message will look like
msgKey=Missing account city for line number {0}

Now in your code you would do something like
    new ActionError("msgKey", <your parameter that will be palced in
stead of {0}>));

If you want to generate your custom messages from within your code then
you basically are killing the idea of all the messages in the central
place and the ease of internationalizing your app, but you can still do
it. Exactly the same way. Just create a custom message in your
Application.resources (or whatever your name might be) file and use the
same construct for ActionError as shown above.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message