You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Renato Romano <r....@set-network.com> on 2004/06/14 17:29:15 UTC
Different input formats
I have an <html:text> input in my form, in which the user should put a
float value. Now I would like to allow the user to enter the Italian
decimal separator, that is comma (",") instead of dot ("."), but of
course I got a null property value for the Float in my ActionForm!! I
then tried to do this by myself, and it works fine, but I have to
directly access request.getParameter("...") which is undesirable, also
because now I have a form in which the former is nested, and so
request.getParameter("...") should take this into account.
Is there a better and "standard" solution to this ?
Thanks everyone
Renato
____________________________________
Renato Romano
Sistemi e Telematica S.p.A.
Calata Grazie - Vial Al Molo Giano
16127 - GENOVA
e-mail: r.romano@set-network.com
Tel.: 010 2712603
_____________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Different input formats
Posted by Robert Taylor <rt...@mulework.com>.
Use Strings as data memebers in your action form when ever possible.
You can "translate" the input in the action class performing what ever
logic is necessary.
robert
> -----Original Message-----
> From: Renato Romano [mailto:r.romano@set-network.com]
> Sent: Monday, June 14, 2004 11:29 AM
> To: 'Struts Users Mailing List'
> Subject: Different input formats
>
>
> I have an <html:text> input in my form, in which the user should put a
> float value. Now I would like to allow the user to enter the Italian
> decimal separator, that is comma (",") instead of dot ("."), but of
> course I got a null property value for the Float in my ActionForm!! I
> then tried to do this by myself, and it works fine, but I have to
> directly access request.getParameter("...") which is undesirable, also
> because now I have a form in which the former is nested, and so
> request.getParameter("...") should take this into account.
>
> Is there a better and "standard" solution to this ?
> Thanks everyone
>
> Renato
> ____________________________________
> Renato Romano
> Sistemi e Telematica S.p.A.
> Calata Grazie - Vial Al Molo Giano
> 16127 - GENOVA
>
> e-mail: r.romano@set-network.com
> Tel.: 010 2712603
> _____________________________________
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org