I have a simple search screen where the user enters group ID. The next screen should populate all the subgroups for this groupID inside a dropdown.
I know my select statement. I don't want to do the db access inside JSP page.
I think it should be done inside the Action class that is invoked when user enters groupID and submit is pressed. My question is how do I put the values inside the dropdown from my Action class.
Pls guide me.
posted 9 years ago
You should have an action for form submittal for when the user selects the initial group id. That action should forward to the page that shows the second select box.
In this action, you should populate a LabelValueBean with the corresponding labels and values of the groups you want in the drop down (that you get from the database). Throw that LabelValueBean into your form and the action will forward to the jsp page (should only have display information in it). You should use html:select and html ptionsCollection to display the drop down.