Two Laptop Bag*
The moose likes Struts and the fly likes Passing more than 1 argument to error message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
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: 130
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: 2902
    
    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://aspose.com/file-tools
 
subject: Passing more than 1 argument to error message
 
Similar Threads
Help with an update sentence within a stored procedure
doubt in constructors?
question about compile error or runtime error
Passing Argument To JavaScript Method
strutsutils is not defined