title: Pass a parameter from one jsp to another using form.action
body: <p>I have an ID that I need in the next jsp once the user click a button.  I am trying to do the following:</p>
  <p>FirstJSP.jsp:</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
      function getSecond() {
          var frm = document.getElementById(&quot;frm&quot;);
          frm.action = &quot;**second.jsp?id=myId;&quot;**
          frm.submit();
      }
  &lt;/script&gt;
  ...
  form id=&quot;frm&quot;
        .....
              input type=&quot;button&quot; value=&quot;Next&quot; onclick=&quot;getSecond()&quot;/
  
   ......
     
  </code></pre>
  <p>This code takes me to my second page, but if I tried to access the id, it gives me an error since the id is null.</p>
  <p>I access the id in the second page by:</p>
  <pre><code>final Long passedId = Long.parseLong(request.getParameter(&quot;id&quot;));
  </code></pre>
  <p>I think I am not passing the parameter correctly, but I don't know how to do it.   Any ideas?  Thank you so much!</p>