This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Struts and the fly likes DynaValidatorForms to JavaBean. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "DynaValidatorForms to JavaBean." Watch "DynaValidatorForms to JavaBean." New topic
Author

DynaValidatorForms to JavaBean.

Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

Ok, I know about BeanUtils.copyProperties and this is fine when you need to copy your ActionForm class to a JavaBean, in my case, a persistant object for Hibernate.

But what if you are using the DynaValidatorForm? How do I go about getting those into my persistant class without calling a set method for each property? Is there an easy way? Or would I be better off using ActionForms of my own and not using Dyna...in this case?

Thanks.
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

Let me ammend this with a simpler question. If I use a DynaValidatorForm instead of my own ActionForm, how do I retrieve a value from the DVF in my action?

For example, if I have this:



How do I get the value for pcModel? do I just pull it out of the request or is there a different/better way?
[ August 10, 2004: Message edited by: Gregg Bolinger ]
Gregg Bolinger
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

Ok, nevermind. I casted the form object to a DynaActionForm object and used the get() method.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DynaValidatorForms to JavaBean.
 
Similar Threads
passed part II/III with 93
spring module bean validation error
Creating an HTTP Header
JavaBean et EJB
how to set Persistant Cookies