Return-Path: Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 95400 invoked from network); 11 Oct 2000 16:59:20 -0000 Received: from mercury.sun.com (192.9.25.1) by locus.apache.org with SMTP; 11 Oct 2000 16:59:20 -0000 Received: from taller.eng.sun.com ([129.144.125.34]) by mercury.Sun.COM (8.9.3+Sun/8.9.3) with ESMTP id JAA15661 for ; Wed, 11 Oct 2000 09:59:14 -0700 (PDT) Received: from eng.sun.com (d-ucup02-251-137 [129.144.251.137]) by taller.eng.sun.com (8.9.3+Sun/8.9.3/ENSMAIL,v1.7) with ESMTP id JAA06791 for ; Wed, 11 Oct 2000 09:59:10 -0700 (PDT) Message-ID: <39E49CA6.D21BB066@eng.sun.com> Date: Wed, 11 Oct 2000 10:00:22 -0700 From: "Craig R. McClanahan" X-Mailer: Mozilla 4.75 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: struts-user@jakarta.apache.org Subject: Re: error with parameters References: <00101110522302.23430@trazom.stylo.it> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N 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 ! Session VS01 (23-Oct 13h00-17h00): Sun Technical Briefing Session T06 (24-Oct 14h00-15h00): Migrating Apache JServ Applications to Tomcat