title: how to get option tag name from one jsp page to select tag of another jsp page
body: <p>Purchase.jsp</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form method="post" action="view.jsp"&gt;
  &lt;select name="category"&gt;
  &lt;option name=''&gt; Make a selection &lt;/option&gt;
  &lt;option name='company'&gt;company&lt;/option&gt;
  &lt;option name='institution'&gt;institution&lt;/option&gt;
  &lt;option name='hospital'&gt;hospital&lt;/option&gt;
  &lt;option name='Others'&gt;Others&lt;/option&gt;
  &lt;/select&gt;
  
  
  &lt;input type='submit' value="Submit" /&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>view.jsp</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;script type="text/javascript"&gt;
  
      function setAction(nPage){
          document.forms[0].action = nPage;
      }
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form&gt;
  &lt;% String Name=request.getParameter("category"); %&gt;
  &lt;select  name="Name" onchange="setAction(this.value)"&gt;
  &lt;option value=''&gt; Make a selection &lt;/option&gt;
  &lt;option name="cat" value='PDF2.jsp'&gt; PDF&lt;/option&gt;
  &lt;option name="cat" value='XLS2.jsp'&gt; XLS &lt;/option&gt;
  &lt;option value='DOC.jsp'&gt; DOC &lt;/option&gt;
  &lt;option value='XLSX2.jsp'&gt; XLSX &lt;/option&gt;
  &lt;/select&gt;
  &amp;nbsp;&amp;nbsp
  
  &lt;input type='submit' value="Submit"&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Now my question is i need to get "company" from purchase.jsp to <code>String Name</code> of view.jsp and get that "Name" into  <code>&lt;select  name="Name" onchange="setAction(this.value)"&gt;</code> so that when i select "PDF.jsp" and click submit that pdf consists of only the data of "company" and nothing else.Here i am using jasper reports to get data into pdf.</p>