title: How can I pass a parameter via submit button?
body: <p>In my  code for an mini online book store i have a following line repeating 5 times with different value for 'name' parameter </p>
  
  <pre><code>&lt;input name="JSP-2" type="submit" value="Buy"&gt;
  </code></pre>
  
  <p>On clicking the button Buy, the application redirects to a file buy.jsp where it gets the value of name and displays corresponding details of the book.</p>
  
  <p>In my buy.jsp, I have included</p>
  
  <pre><code>    &lt;% String bname= request.getParameter("name");
  out.print(bname);
  %&gt;
  </code></pre>
  
  <p>But the name doesnt get assigned to bname and it shows the value as null. How do I pass a parameter from the submit type input?
  Please help.</p>