Thanks Craig, First I didn't know about the new enhancement in JDK 1.5 so thanks. Secondly, I was just curious about all this cause I read the code of DynaActionForm and saw some code dealing with the primitive types.
Erez -----Original Message----- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: Saturday, September 06, 2003 7:16 PM To: Struts Users Mailing List Subject: Re: Primitive Types in DynaActionForm On Sat, 6 Sep 2003, Erez Efrati wrote: > Date: Sat, 06 Sep 2003 12:26:55 +0200 > From: Erez Efrati <[EMAIL PROTECTED]> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]> > To: 'Struts Users Mailing List' <[EMAIL PROTECTED]> > Subject: Primitive Types in DynaActionForm > > Hi, > > Can someone please explain me what is the deal with primitive types in a > DynaActionForm? Has someone used it? > You have to use the corresponding "wrapper" objects instead of primitives. For example, if you want to store an int property with a value of 123, you'd do: dynabean.set("value", new Integer(123)); int value = ((Integer) dynabean.get("value")).intValue(); In JDK 1.5 the need to do this will go away, because the compiler will automatically box and unbox primitive values for you, but for now you have to do it yourself. > Thanks in advance, > Erez > Craig --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]