wood burning stoves 2.0*
The moose likes Struts and the fly likes TypeConversion with Struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "TypeConversion with Struts 2" Watch "TypeConversion with Struts 2" New topic
Author

TypeConversion with Struts 2

Reghu Ram Thanumalayan
Ranch Hand

Joined: Oct 21, 2003
Posts: 193
Hello Brown,
With Struts 1.2, i faced most problems with converting types between the formbean and the domain object. The BeanUtils class wasnt able to cover all the possible kids of conversions.

With Struts 2, I see that type conversion is being handled by OGNL. Does OGNL cover all possible kinds of conversions between the formbean and the domain objects ?

Regards,
Reghu


Cheers,<br />Reghu Ram T<br /> <br />SCJP 1.4 - 98 %, SCBCD 1.3 - 94 %, SCMAD 1.0 - 92 %
Jeremy Anderson
author
Ranch Hand

Joined: Apr 26, 2005
Posts: 32
Well first, struts2 removes the need for a separate formbean object.

As for type conversion, it's fairly simple to create the type converters yourself if one doesn't exist. Look at the DateConverter provided by the struts2 starter maven archetype.


[ April 29, 2008: Message edited by: Jeremy Anderson ]
Reghu Ram Thanumalayan
Ranch Hand

Joined: Oct 21, 2003
Posts: 193
Hi Jeremy,

Thanks for the pointers to StrutsTypeConvertor

Regards,
Reghu
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TypeConversion with Struts 2