Hi All,

Is there a way to skip evaluation of ${} and %{} in TextParseUtil.
Here is the reason i need this

I need to display validation errors and need to pass parameters to messages
defined in resource bundles.

this is how i have defined message in property file

mobile.number=Please provide a valid mobile number between {min} and {max}

and this is how validation is defined
 @Size(min=10, max=12, message="mobile.number")
private String mobileNumber;

So ultimately, I need to display following message to user

Please provide a valid mobile number between 10 and 12.

Here {min} and {max} values are being picked from the defined annotation.
I can get values of annotations as well values of {min} and {max} from
Underlying bean validator and can replace those values.

I am using Struts2 DelegatingValidatorContext to find values with respect
to the key defined in validation constraints and while doing this, Struts2
is trying to parse those place holders ({min} and {max}) defined in message
resource bundle.

My idea is to not parse these place holders and let Struts2's TextParseUtil
return message with respect to key as it is.

Is there any way to do this or i need to customize this ?

Thanks in advance.

-- 
With Regards
Umesh Awasthi
http://www.travellingrants.com/

Reply via email to