users@glassfish.java.net

RE: HTTP Status 405 - HTTP method GET is not supported by this URL

From: <w.rittmeyer_at_jsptutorial.org>
Date: Mon, 23 Mar 2009 17:52:23 +0100

Hi,

this is the expected behaviour since you do not overwrite the doGet(HttpServletRequest, httpServletResponse) method.

You could add a method doGet as follows:

public void doGet(HttpServlet req, HttpServletResponse rep) throws IOException, ServletException {
        doPost(req, rep);
}

Thus no matter whether GET- or POST-requests are used, both are handled the same way.

But you should be careful and consider if this really is what you want. The semantics for GET and POST are different according to the HTTP spec (though a lot of apps do not care).


--
Wolfram Rittmeyer