title: Passing parameter to next JSP page by a 3rd-party-Servlet-generated form
body: <p>I'm trying to fix a bug in a legacy application in my organization. I need to pass an extra parameter in a dynamically generated form. </p>
  
  <p><code>page1.jsp</code></p>
  
  <pre><code>&lt;%
      request.setAttribute("param", param);
      // ...
  %&gt;
  
  &lt;form name="xx"&gt;   
      ...
  &lt;/form&gt;   
  &lt;jsp:include page="servlet1" /&gt;
  </code></pre>
  
  <p>The <code>Servlet1</code> is calling another <code>Servlet2</code>, which in turn calls <code>Servlet3</code> to print some code to <code>page1.jsp</code>. The generated HTML output looks like this:</p>
  
  <pre><code>&lt;form name="xx"&gt;   
      ...
  &lt;/form&gt;   
  &lt;form name="yy" action="page2.jsp" &gt;   
      ...   
      &lt;input type="submit"&gt;   
  &lt;/form&gt;  
  </code></pre>
  
  <p>I need to be able to pass "param" value from <code>page1.jsp</code> to <code>page2.jsp</code>. The <code>request.setAttribute()</code> is not working. The Servlet class <code>Servlet3</code> is vendor provided, so I cannot set a hidden form variable inside form "yy" to pass it to <code>page2.jsp</code>. </p>
  
  <p>How can I achieve this in other way?</p>