Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SC_METHOD_NOT_ALLOWED

 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Does the SC_METHOD_NOT_ALLOWED appears when we dont provide the correct implementation for the corresponding doXXX methods or only doPOST applies to this?
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I dont override doHEAD, I'm not getting the SC_METHOD_NOT_ALLOWED. WHY?
 
Rancy Chadha
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jothi,

Which container are you using to deploy your applications?
If it is tomcat then the source code for doHead() method is not implemented to throw error. You can have a look at the source code of HttpServlet class HERE
This should help you clear your doubt.

Thanks,
-Rancy
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it container dependend or is it according to the servlet specs?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not the servlet spec, but the HTTP spec. RFC 2616 (the HTTP 1.1 spec), Section 5.1.1 has this to say:
An
origin server SHOULD return the status code 405 (Method Not Allowed)
if the method is known by the origin server but not allowed for the
requested resource, and 501 (Not Implemented) if the method is
unrecognized or not implemented by the origin server. The methods GET
and HEAD MUST be supported by all general-purpose servers. All other
methods are OPTIONAL;
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Similar Threads