HTTP method GET is not supported error when the JSP is making POST request to the servlet
posted 5 years ago
I have this JSP. The same JSP is to ask for data and display all the previously entered data. This JSP is making a POST request to servlet which put the data coming from parameters of each request in the ServletContext. The first time when I enter data and hit Submit button it works. But for second request there is "HTTP Status 405 - HTTP method GET is not supported by this URL" error. When I override doGet() or redirect the response instead of doing forward, it works.
In JSP the method is POST. i.e every time JSP is making POST request to the servlet. So why there is that 405 error?
The servlet Sample.java:
ChatAdmin.jsp Code Fragment