0

How can I drive the value of the dropdown option from the servlet?..strong text First time user access configuration User Selects option from drop down window, Option forwarded to servlet, Option Stored in DB. -> Option reloaded in webpage user sees option selected not first option

JSP code snippet:

<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 code snippet:

request.setAttribute("formLogoLocation", formLogoLocation);
RequestDispatcher formreload = request.getRequestDispatcher("formmanagement.jsp");
formreload.forward(request, response)
tommybee
  • 2,409
  • 1
  • 20
  • 23
GMan
  • 1
  • 1
  • <%String formLogoLocation=(String)request.getAttribute("formLogoLocation"); %> – GMan Sep 25 '17 at 01:20
  • I reviewed the link and it worked like a charm for me..thanks a lot!!!! – GMan Sep 25 '17 at 18:34

0 Answers0