如何从servlet中驱动下拉选项的值?..强文本 首次用户访问配置 用户从下拉窗口中选择选项,选项转发到servlet,选项存储在DB中。 - >在网页用户中重新加载选项会看到选项不是第一个选项
JSP代码段:
<form class="center-container" method="post" action="ReloadFormPageServlet">
<tr>
<td><%String formLogoLocation=(String)request.getAttribute("formLogoLocation"); %>
<class="ui-field-contain"><label for="formlogoLocation">Form Logo Location:</label></td><td>
<select name = "formLogoLocation" id = "formLogoLocation">
<option value = "1">Upper Left</option>
<option value = "2">Upper Center</option>
<option value = "3">Upper Right</option>
</select>
</td>
</tr>
</form>
Servlet代码段:
request.setAttribute("formLogoLocation", formLogoLocation);
RequestDispatcher formreload = request.getRequestDispatcher("formmanagement.jsp");
formreload.forward(request, response)