This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts 1.2.4 - POJO Support Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Struts 1.2.4 - POJO Support" Watch "Struts 1.2.4 - POJO Support" New topic
Author

Struts 1.2.4 - POJO Support

Matthew Marquand
Ranch Hand

Joined: Dec 19, 2002
Posts: 32
The importance of our ActionForms is decreasing over the 2 years that our application has been in production. Most of our ActionForms are nothing more than a holder of a presentation-level POJO bean "delegate" that the tiles use directly. So I was glad to see that Struts 1.2.4 has better support for using POJO beans as a direct substitute for coding up an ActionForm. I have looked at the source to see how this is being accomplished and saw that the POJO is wrapped with a WrapDynaBean and that bean is wrapped with a BeanValidatorForm.

I have also seen the comment in BeanValidatorForm above the getInstance method that you cannot get direct access to the POJO from the Action until struts 1.2.4 upgrades to BeanUtils 1.7.0 or greater. That's all understandable.

However, my question is: Is there a compelling reason why BeanValidatorForm doesn't define a setInstance method in addition to a getInstance method?

Many of our Actions obtain a presentation-level POJO and without setInstance we would have to use PropertyUtils or something like that to copy the properties into the one hanging off the form.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Struts 1.2.4 - POJO Support
 
Similar Threads
User Transaction on private method
Pattern for DOS/console + Entity(ejb3)
Another way to write getInstance for singleton?
What technology to study for my thesis? (...about j2ee)
Struts 2