Note that there are some explanatory texts on larger screens.

plurals
  1. POgo to jsp page by hitting back button
    text
    copied!<p>I have <code>2 jsp pages and one Servlet</code>. I am fetching data from database by servlet and sending result to <code>result.jsp</code> page where i am displaying result. But i want to add a <code>Back button</code> in <code>result.jsp</code> , by clicking <code>back button</code> i want to go to <code>index.jsp</code>, but problem is when i am clicking back button everytime a message is coming <code>Confirm form submission</code> and it is irritating me. How can i avoid this <code>Confirm form submission</code>? perhaps it is coming as processing is done in servlet.</p> <p>index.jsp</p> <pre><code>&lt;form method="post" action="Student"&gt; &lt;input type="text" name="studentname"/&gt; &lt;input type="submit" value="search"/&gt; &lt;/form&gt; </code></pre> <p>Student servlet</p> <pre><code> String student_name=request.getParameter("studentname"); -------fetching data from database------------ -------------------sending to result.jsp------ String nextJSP = "/result.jsp"; RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(nextJSP); dispatcher.forward(request,response); </code></pre> <p>result.jsp</p> <pre><code> //displaying data here &lt;form action="index.jsp"&gt; &lt;input type="submit" value="back"/&gt;// a back button is here which is going to index.jsp &lt;/form&gt; </code></pre> <p><strong>EDIT</strong></p> <p>From <code>result.jsp</code> i am going to another page <code>result1.jsp</code> like below</p> <p>In <code>result.jsp</code> i have written the following:</p> <pre><code>&lt;a href="result1.jsp.jsp?a code=&lt;%out.println(student_name);%&gt;"&gt;&lt;%out.println(student_name);%&gt;&lt;/a&gt; </code></pre> <p>By clicking the above hyperlink i went to <code>result1.jsp</code></p> <p>I want to add a back button here(in result1.jsp) and after clicking i want to do to result.jsp, but when clicking back button i am getting <code>Confirm form submission</code> every time. I have written the following in <code>result1.jsp</code></p> <pre><code>&lt;input type="button" value="Back" onclick="javascript:history.go(-1)"&gt; </code></pre> <p>Still i am getting that message <code>Confirm form submission</code>. How can i avoid this? I want to go to <code>result.jsp</code> directly with out this message. How is it possible?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload