It's not a secret anymore!
The moose likes Struts and the fly likes Passing more than 1 argument to error message Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Passing more than 1 argument to error message" Watch "Passing more than 1 argument to error message" New topic
Author

Passing more than 1 argument to error message

Imre Tokai
Ranch Hand

Joined: Jun 04, 2008
Posts: 129
Hello,


I'm adding errors to via:

and i don't know how to pass more than 1 argument?


If error message is: "{0} must be unique", contains the value that will replace {0}.
But what if I want to have error message: "{0} must be greater than {1}"?
How to pass the argument that will replace {1}?


Regards


Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2896
    
    1

Try adding two arguments in the same 'Field' object

http://commons.apache.org/validator/api-1.3.1/org/apache/commons/validator/Field.html#addArg(org.apache.commons.validator.Arg)

field.addArg(); // {0}
field.addArg(); // {1}


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Passing more than 1 argument to error message
 
Similar Threads
doubt in constructors?
Passing Argument To JavaScript Method
question about compile error or runtime error
strutsutils is not defined
Help with an update sentence within a stored procedure