I am looking for a way to automatically populate a dropdown list within a JSP page form using values retrieved from a database query. The challenge is that only a limited number of rows are being pulled from the database based on other form inputs. I am not familiar with jQuery or any other advanced tools, so I need guidance on how to achieve this.
Specifically, I need to retrieve the state of an employee from the database based on the employee ID entered in the form. Then, I want to dynamically generate a dropdown list containing the various office branches located in that state. I want to achieve this all within a single form on a single page without the need to navigate to multiple pages. Can anyone provide assistance on how I can go about populating this dropdown in a JSP page?