commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <grahamdavid1...@yahoo.com>
Subject Re: [Validator] How to create messages with more than one placeholder
Date Thu, 25 Mar 2004 14:03:46 GMT
I would use the standalone example in cvs to test different scenarios so
you isolate errors from your application.  That way we can find out if
it's a bug in validator or your app.  

In the past, validator only allowed up to 4 replacement args with <arg1>,
<arg2>, etc.  We changed this to a generic <arg> element with a position
attribute.  It's possible that the old <arg1> system was broken during the
change.  I can test it out this weekend but all help is appreciated :-).

David

--- Eric.Lewis@swissinfo.ch wrote:
> Hi
> 
> I just added the maxLength validator (from Struts) into my validators
> and am
> now trying to have a second placeholder value in my error message.
> 
> My form looks like this:
>       <form name="DummyVo">
>          <field property="name" depends="required,name,maxlength">
>          	   <arg0 key="label.name.title"/>
>          	   <arg1 name="maxlength" key="${var:maxlength}"
> resource="false"/>
>          	   <var>
>          	   		<var-name>maxlength</var-name>
>          	   		<var-value>5</var-value>
>          	   </var>
>          </field>    
>       </form>
> 
> which should at least work in Struts (I'm trying to stay compatible).
> 
> The message would be (copied from Struts):
> messages.validator.maxlength = The {0} can not be greater than {1}
> characters.
> 
> 
> When the check fails, I show all arguments and get this result:
> Argument 0
> Arg: name=null  key=label.name.title  resource=true
> 
> Argument 1
> null
> 
> Does anyone have a clue why this doesn't work?
> 
> Also, what is the difference between having several arguments with
> <arg0...>, <arg1...> and having them with <arg...>, <arg...>?
> 
> Thanks for any help!
> Eric
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

---------------------------------------------------------------------
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