• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTP method GET is not supported error when the JSP is making POST request to the servlet

 
manasee patel
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

-------------------------------------------------
web.xml:

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


If that is really the way your web.xml reads, I am surprised you get anything. ALL classes used in servlets should be in a package.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic