You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mike Bell <be...@dsg-inc.com> on 2001/01/30 18:16:17 UTC

ActionError without using message resource?

Hello,

Is it possible to create an ActionError without using a message resource?
At this time we don't really have a need for a message resource and would
like to just put the error message string directly in the call.

like:

    ActionErrors errors = new ActionErrors(); 
    errors.add("name", new ActionError("The Error String"));

-Mike


Re: ActionError without using message resource?

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Mike Bell wrote:

> Hello, Is it possible to create an ActionError without using a message
> resource?At this time we don't really have a need for a message
> resource and wouldlike to just put the error message string directly
> in the call. like:     ActionErrors errors = new ActionErrors();
> errors.add("name", new ActionError("The Error String")); -Mike

You can certainly construct an ActionErrors collection based on using
the actual strings, but you will not be able to use the <html:errors/>
tag to display them -- you would need to build your own mechanism for
this, perhaps by subclassing the ErrorsTag class to operate slightly
differently.

Craig


Re: ActionError without using message resource?

Posted by Tom Janofsky <to...@yahoo.com>.
Good question.  Is the use of ActionError and the properties file
coupled?  Or can you code your errors in-line?

--tom

> Mike Bell wrote:
> 
> Hello,
> 
> Is it possible to create an ActionError without using a message
> resource?
> At this time we don't really have a need for a message resource and
> would
> like to just put the error message string directly in the call.
> 
> like:
> 
>     ActionErrors errors = new ActionErrors();
>     errors.add("name", new ActionError("The Error String"));
> 
> -Mike
>