title: SELECT tag values not getting in Servlet
body: <p>I have form field in my JSP page. It has Select tag with few values. I need to select only one value and based on that in my servlet I will forward to other pages.
  Here is my JSP code for Select tag</p>
  
  <pre><code>&lt;select name="options"&gt;
      &lt;option&gt;Choose Your Option&lt;/option&gt;
      &lt;option value="option1"&gt;Option 1&lt;/option&gt;
      &lt;option value="option2"&gt;Option 2&lt;/option&gt;
      &lt;option value="option3"&gt;Option 3&lt;/option&gt;
      &lt;option value="option4"&gt;Option 4&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>In my servlet I am processing based on the selected value. Here is my servlet code</p>
  
  <pre><code>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
      {
  String options[]=request.getParameterValues("options");
          if(options[0].equals("option1"))
          {
              RequestDispatcher rd=request.getRequestDispatcher("Option1.jsp");
              rd.forward(request, response);
          }
          else if(options[0].equals("option2"))
          {
              RequestDispatcher rd=request.getRequestDispatcher("Option2.jsp");
              rd.forward(request, response);
          }
          else if(options[0].equals("option3"))
          {
              RequestDispatcher rd=request.getRequestDispatcher("Option3.jsp");
              rd.forward(request, response);
          }
          else if(options[0].equals("option4"))
          {
              RequestDispatcher rd=request.getRequestDispatcher("Option4.jsp");
              rd.forward(request, response);
          }
      }
  </code></pre>
  
  <p>And the real problem is, when I select Option 1 or Option 2 It will be forwarding to the respective pages. But if I select Option 3 or Option 4, It won't work. What is the problem? What should I do? Thanks</p>