commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Validator] How to create messages with more than one placeholder
Date Thu, 25 Mar 2004 09:41:00 GMT

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=""/>
         	   <arg1 name="maxlength" key="${var:maxlength}"

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}

When the check fails, I show all arguments and get this result:
Argument 0
Arg: name=null  resource=true

Argument 1

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!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message