aspose file tools*
The moose likes Servlets and the fly likes HTTP method GET is not supported error when the JSP is making POST request to the servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTTP method GET is not supported error when the JSP is making POST request to the servlet" Watch "HTTP method GET is not supported error when the JSP is making POST request to the servlet" New topic
Author

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

manasee patel
Greenhorn

Joined: Nov 17, 2010
Posts: 6
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

Joined: Mar 22, 2000
Posts: 12806
    
    5


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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: HTTP method GET is not supported error when the JSP is making POST request to the servlet