title: add a back button in jsp
body: <p>I have <code>3 jsp pages(index.jsp, result1.jsp,result2.jsp)</code> and one <code>servlet</code>. Processing is being done as below:</p>
  
  <p>index.jsp</p>
  
  <pre><code>&lt;form method="post" action="MYSERVLET" &gt;
  &lt;input type="text" name="studentname" id="studentname"/&gt;
  &lt;input type="submit" value="click" /&gt;// goes to a servlet named as MYSERVLET
  &lt;/form&gt;
  </code></pre>
  
  <p>MYSERVLET</p>
  
  <pre><code> String t=request.getParameter("studentname");
  ------fetching data from database and sending to result1.jsp------
  
        String nextJSP = "/result1.jsp";
        RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(nextJSP);
        dispatcher.forward(request,response);
  </code></pre>
  
  <p>result1.jsp</p>
  
  <p>//retrieving data from servlet and displaying data in <code>result1.jsp</code> and also passing the same value to <code>result2.jsp</code></p>
  
  <pre><code>out.println(retrieved result from servlet);
  &lt;a  href="result2.jsp?somestring=&lt;%out.println(retrieved result from servlet);%&gt;"&gt; &lt;%out.println(retrieved result from servlet);%&gt;&lt;/a&gt;// after clicking on "retrieved result from servlet" i am passing this retrieved value to another jsp result2.jsp and also retrieving some data from database as follows:
  </code></pre>
  
  <p>result2.jsp</p>
  
  <pre><code>String w=request.getParameter("somestring");
  out.println(w);
  </code></pre>
  
  <p>I want to give a <code>back button here (in result2.jsp)</code> so that after clicking <code>back button</code> it will take me to <code>result1.jsp</code> where i can see the previously displayed data<code>(out.println(retrieved result from servlet);)</code>. But when i click browser back button(in result2.jsp) then each time alert is coming <code>"Confirm Form Resubmission"</code>  and then i am reloading that page to see <code>(out.println(retrieved result from servlet);)</code>,i want to avoid this alert, how can i avoid it? How can i straightly see that page without any alert?</p>