Domanda

i have signup page when i first submitting the data in form action i am sending it to a servlet before submiting my url is **Localhost:\Shop

**

<form action="signup" method="post">

and in this servlet i have businesses logic after submitting it i am forwarding it to my index page by

` request.getrequestdispatcher("index.jsp").forward(request,response);

now my URL is localhost:\Shop\SignUp now when i refresh this page it gives me warning

Confirmation Form Resolution

How do i avoid this problem ????

È stato utile?

Soluzione

It is because you are posting the same request to the server as you are using RequestDispatcher method.

You need to understand the differences between RequestDispatcher.forward() vs HttpServletResponse.sendRedirect()

So you need to use the sendRedirect() method to create a new request

response.sendRedirect("index.jsp");

Hope this helps!!

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top