Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TypeConversion with Struts 2

 
Reghu Ram Thanumalayan
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jeremy Anderson
author
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeremy,

Thanks for the pointers to StrutsTypeConvertor

Regards,
Reghu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic