commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric.Le...@swissinfo.ch
Subject [Validator] How to create messages with more than one placeholder
Date Thu, 25 Mar 2004 09:41:00 GMT
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


Mime
View raw message