2013/10/27 Umesh Awasthi <umeshawas...@gmail.com>:
> 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.

Are you sure? There is no opening chars (either $ or %)...

> 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 ?

You can implement your own TextParser.


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to