When using jsp for web development, drop-down menus are used in many situations. I did it a few months ago, but I forgot about it today. It took me a long time to find it, so I wrote it down today.
<select name="sortname" >
<%
while(iterator.hasNext()){ String name = ((Sort)iterator.next()).getName(); %>
<option name="sortname" value="<%=name%>"><%=name%></option>
<% } %>
</select>
Note: name is a database-related field!
The above is the main code. Add the iterator code in front of it, and the subsequent action can get the sortname for related operations.
In fact, once you do it, you will find that it is very simple.
The next step is to learn to use struts tags. Roughly use the <html:options> tag.