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 ????

有帮助吗?

解决方案

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!!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top