You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Chen, Gin" <Gi...@NielsenMedia.com> on 2003/05/07 23:59:30 UTC

Brain fart with DynaForms and primatives

I am having a brain fart here.
If I have a DynaActionForm declared with primatives.
(int for example)
How do I retrieve the value back as a int?
I think it is:
Integer myInt = myForm.get("myIntProperty");
myInt.intValue();

right?
Is there an easier way? Some util class that auto detects the right
convertion?
Thanks,
-Tim

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


RE: Brain fart with DynaForms and primatives

Posted by Steven Santiago <sm...@neca.com>.
This would work I believe

int myInt = ((Integer)myForm.get("myIntProperty")).intValue();

Stee
-----Original Message-----
From: Chen, Gin [mailto:Gin.Chen@NielsenMedia.com] 
Sent: Wednesday, May 07, 2003 6:00 PM
To: 'Struts Users Mailing List'
Subject: Brain fart with DynaForms and primatives


I am having a brain fart here.
If I have a DynaActionForm declared with primatives.
(int for example)
How do I retrieve the value back as a int?
I think it is:
Integer myInt = myForm.get("myIntProperty");
myInt.intValue();

right?
Is there an easier way? Some util class that auto detects the right
convertion? Thanks, -Tim

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



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