File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes dynamically loading a form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "dynamically loading a form" Watch "dynamically loading a form" New topic

dynamically loading a form

trisha grissom

Joined: Jun 19, 2003
Posts: 1
I want to load a form with different choices for the user. These choices are loaded in the input fields of the form depending on the result set of an SQl call.How can this be done using struts framework.
Thank you.
Darryl A. J. Staflund
Ranch Hand

Joined: Oct 06, 2002
Posts: 303
Hi Trisha,
Your best bet would be to create two Struts actions -- one that has the responsibility of populating your form and/or request objects with the information you want to display on the form page, another that has the responsibility of processing the form once the customer has modified and submitted it back to the server. The JSP page that is displayed in between actions would then use information provided in the first action to populate the form fields, as well as post the form to the second action.
[ June 20, 2003: Message edited by: Darryl A. J. Staflund ]
I agree. Here's the link:
subject: dynamically loading a form
jQuery in Action, 3rd edition