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.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com