title: how to pull selected radio button in a jsp
body: <p>I have two radio buttons, and depending on which one is selected I want to send them to a specific jsp page. I do not know how to pull which button is selected in my java class. </p>
  
  <p>Here is the jsp:</p>
  
  <pre><code>&lt;form method="post" action="ttp.actions.Sale1Action.action"&gt;
  
          &lt;input type="radio" name="radio1" value="packages"checked&gt; packages&lt;br&gt;
          &lt;input type="radio" name="radio1" value="productions"&gt; productions&lt;br&gt;
  
      &lt;input type="submit" value="  next  "/&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>here is the java:</p>
  
  <pre><code>public class Sale2Action implements Action {
  
      public String process(HttpServletRequest request, HttpServletResponse response) throws Exception {
  
  
          String prodPack = request.getParameter("radio1");
          System.out.println("radio1 = " + prodPack);
          String venueID = request.getParameter("venueid");
          Venue v = VenueDAO.getInstance().read(venueID);
  
  
          if (prodPack.equals("packages")) {
              return "sale3a.jsp";
          } else {
              return "sale3b.jsp";
          }
      }
  }
  </code></pre>