This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes pre-populate form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "pre-populate form" Watch "pre-populate form" New topic
Author

pre-populate form

M Smith
Greenhorn

Joined: Feb 26, 2004
Posts: 2
I have a number of links on the page - update email, change address. When the link is clicked I need to create a form (put in the request?)- pre-populate it with the user information so when the JSP is loaded the information is displayed for user to update. I think I need manually instantiate and pre-populate an
action form before forwarding to JSP.
Any suggestions would be greatly appreciated
Srikanth Shenoy
author
Ranch Hand

Joined: Jan 24, 2004
Posts: 184
Smith,
You have to manually instantiate and prepopulate the ActionForm. There is no way around it. However you can use the BeanUtils.copyProperties() from Common BeanUtils package to reduce some of the burden of copying from source to the target.
-Srikanth Shenoy


Srikanth Shenoy
Author of Struts Survival Guide : Basics to Best Practices
M Smith
Greenhorn

Joined: Feb 26, 2004
Posts: 2
Hi,
Do you have a code example on how to do this correctly?
Thank you!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: pre-populate form
 
Similar Threads
Variable value attribute in jsp:setProperty
transfer Bean between JSP and backend
Dynamic forms and pages
how to do a survey app ???
poulate a form from the reset (good practice)?