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 55987 invoked from network); 10 Oct 2000 17:10:57 -0000 Received: from ns1.selectica.com (HELO acorn.selectica.com) (root@4.21.57.11) by locus.apache.org with SMTP; 10 Oct 2000 17:10:57 -0000 Received: from it-exch.selectica.com (hq.selectica.com [10.0.12.41]) by acorn.selectica.com (8.9.3/8.9.3) with ESMTP id KAA03951 for ; Tue, 10 Oct 2000 10:10:56 -0700 Received: by hq.selectica.com with Internet Mail Service (5.5.2650.21) id <441FFZL4>; Tue, 10 Oct 2000 10:10:55 -0700 Message-ID: From: "Proetel, Ingo" To: "'struts-user@jakarta.apache.org'" Subject: RE: error with parameters Date: Tue, 10 Oct 2000 10:10:54 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N I have not seen the earlier discussion, so if this is old stuff just ignore it. 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. ingo > -----Original Message----- > From: Martin Cooper [mailto:martin.cooper@tumbleweed.com] > Sent: Monday, October 09, 2000 8:28 PM > To: struts-user@jakarta.apache.org > Subject: Re: error with parameters > > > I suggested a simple change to enable this a few weeks ago. > Unfortunately > (in my opinion), the discussion got a little carried away > with inventing > quite sophisticated error reporting mechanisms. > > What I had suggested was adding an errors.format value in > addition to the > existing errors.header and errors.footer values. I'll admit > that this is not > nearly as flexible as some of the other suggestions made, but > it would be a > very simple addition to the existing tag that > wouldn't break > any existing code. > > -- > Martin Cooper > Tumbleweed Communications > > ----- Original Message ----- > From: "Christophe Thiebaud" > To: > Sent: Monday, October 09, 2000 10:29 AM > Subject: error with parameters > > > Is there a way to use parameterized errors with struts ? > > in the example application the file ApplicationResources.properties > has several string with a {0] tag, > (e.g. linkSubscription.noSubscription=No subscription under > attribute {0} > > but these strings are used only to throw JspException > objects, like in: > > // Print this element to our output writer > JspWriter writer = pageContext.getOut(); > try { > writer.print(results.toString()); > } catch (IOException e) { > throw new JspException > (messages.getMessage("linkSubscription.io", e.toString())); > } > > there is no way currently to have the struts tag ErrorsTag handle > parameterized > errors. > > how do struts users manage that ? > > Christophe > >