struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aur Gal <...@dovesolutions.com>
Subject RE: error with parameters
Date Wed, 11 Oct 2000 17:04:12 GMT
Great, while you guys are at it, any chance to paramaetrize/conditionalize
the errors.header and errors.footer?

-----Original Message-----
From: Craig R. McClanahan [mailto:Craig.McClanahan@eng.sun.com]
Sent: Wednesday, October 11, 2000 12:00 PM
To: struts-user@jakarta.apache.org
Subject: Re: error with parameters


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.

Craig

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


Mime
View raw message