I have one 2 jsp pages and one Servlet. I retrieve the data from the database with the servlet and send the result to the page result.jspwhere I show the result. But I want to add Back buttonin result.jsp, by clicking Back button, I want to go to index.jsp, but the problem is that when I press the back button every time a message arrives Confirm form submissionand it annoys me, How can I avoid this Confirm form submission? perhaps this will happen because the processing is done in the servlet.
index.jsp
<form method="post" action="Student">
<input type="text" name="studentname"/>
<input type="submit" value="search"/>
</form>
Student servlet
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);
result.jsp
<form action="index.jsp">
<input type="submit" value="back"/>
</form>
EDIT
From result.jspI go to another page result1.jspas shown below
In result.jspI wrote the following:
<a href="result1.jsp.jsp?a code=<%out.println(student_name);%>"><%out.println(student_name);%></a>
By clicking the hyperlink above, I went to result1.jsp
( result1.jsp), " result.jsp", "" Confirm form submission . result1.jsp
<input type="button" value="Back" onclick="javascript:history.go(-1)">
Confirm form submission. ? result.jsp . ?