• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[IMP]Whydoes it give 403 Method not found exception..??

 
deepanjan Dey
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Why do we get 403 Method not found exception for servlet if we don't override doPost/doGet method in our servlet and declare method = POST/GET in jsp.

Why does it not call the doGet/doPost method of Parent class HttpServlet.
Please reply.

Regards,
Deepanjan
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't 403 a "Forbidden" code?

I think the code for a method not supported is a 405.
 
deepanjan Dey
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But why we get that error..??

Why does it not call the doGet/doPost method of Parent class HttpServlet..??

Regards,
Deepanjan
 
Rhett Wang
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They are like this:

protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
{
String protocol = req.getProtocol();
String msg = lStrings.getString("http.method_post_not_supported");
if (protocol.endsWith("1.1")) {
resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
} else {
resp.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
}
}

SC_METHOD_NOT_ALLOWED-----405
SC_BAD_REQUEST------------400

code 403 should be brought by other things.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic