commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric.Le...@swissinfo.ch
Subject RE: [Validator] How to create messages with more than one placeho lder
Date Mon, 29 Mar 2004 09:46:25 GMT
Ok, after deleting the name attribute, this works now - thanks a lot!

Eric

-----Original Message-----
From: David Graham [mailto:grahamdavid1980@yahoo.com]
Sent: Sonntag, 28. März 2004 23:50
To: Jakarta Commons Users List
Subject: Re: [Validator] How to create messages with more than one
placeholder

How are you getting the Arg objects?  My guess is you're doing something
like:
Field.getArg(0)
Field.getArg(1)

The first call returns the correct Arg object because you didn't specify a
name attribute in the xml.  The second call returns null because the xml
is <arg1 name="maxlength"...  To properly retrieve the second Arg you need
to call Field.getArg("maxlength", 1).

Note that if you don't specify a name attribute, calling
Field.getArg("maxlength", 1) will still work because it looks for the
default arg when it can't find one with the name "maxlength".

Look at Struts' Resources.getArgs() method for examples.

David


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message