Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

[S2] Submitting a Double => pb of locale

MLENEVEUT

2007-08-03

Replies:

Hi,

When I submit a numeric in a form, the validation accepts only dotted
numbers (12,34) (I'm with a French locale). If a set 12.34, the validation
failed and I have the message : "Invalid field value for field "xx""

But when a submit 12,34 and another field has an error, I come back to my
JSP with 12.34 has my number's value. So when correct the error and
re-submit, the numeric field has now an error.

Where is the problem ? My field is a Double in my bean.

How can I correct the problem ? In an Intercetor ? (extending
ParametersInterceptor ?)

And How could I change the default message "Invalid field value for field
"xx"" ? What is the key to put in my package_xx.properties ?

Thanks a lot.
©2008 junlu.com - Jax Systems, LLC, U.S.A.