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 copying formbean 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 "copying formbean" Watch "copying formbean" New topic
Author

copying formbean

Pranav Sharma
Ranch Hand

Joined: Oct 27, 2003
Posts: 254
Since no one answered my last question, Im just gonna go with one form bean for all jsp pages which are all set and get in a set.

I have a follow up question though, is there anyway to set all the data(from the DB in a set) to my form bean at one go. or do i have to set them manually.


thanks
pranav
alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
in your struts-config.xml you can define a form-bean that has 1 property, say 'myFormBean' of type 'com.my.db.DTOBean'. you can pass the entire data object into the form property inside your action. in your jsp, you can refer to your object's properties using the reference 'myFormBean.lastName' etc. this expression language reference can be used inside the actions and validation.xml definitions as well.


-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: copying formbean
 
Similar Threads
Will the setters be called
Combo box building
Best way to do form input ?
Moving a bean from request to session context
JSP and ValueBean..Tight Coupling..