File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
transfer Bean between JSP and backend
how to do a survey app ???
Variable value attribute in jsp:setProperty
Dynamic forms and pages
poulate a form from the reset (good practice)?