struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: error with parameters
Date Wed, 11 Oct 2000 17:00:22 GMT
Christophe Thiebaud wrote:

> On Tue, 10 Oct 2000, you wrote:
> > I suggest to add a new function to add a new method to ErrorMessages:
> >
> >
> >   public void addError(String key,Object[] args)
> >
> >
> >  the ErrorTag class needs then to be adjusted to query for the arguments and
> > use the with the correct error key.
> >
> > And in the Action class the saveErrors() method need to be adjusted to store
> > the ErrorMessages object instead of the String[].
> >
> > This change to the code seems quite simple and it is as easy to use as the
> > current mechanism.
> >
> that looks good, doesn't it Craig ?
> It looks enough simple as I could even i,plement  it and check it in if OK
> Christophe

It is a good idea.

I'm actually going to checking in a slightly extended version of this idea.  The
new ActionErrors object will have the following new capabilities:

* You can save parametric replacements along with your message
  keys so that you can use {0}, {1} type substitutions.

* You can optionally associate individual error messages with
  individual property names, or just leave them global.  This gives
  the presentation layer the ability to do more interesting things
  than just display all the errors at the top of the page.


See you at ApacheCon Europe <>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat

View raw message