Meaningless Drivel is fun!
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes SC_METHOD_NOT_ALLOWED Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)


Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 10033


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?

SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 10033

If I dont override doHEAD, I'm not getting the SC_METHOD_NOT_ALLOWED. WHY?
Rancy Chadha
Ranch Hand

Joined: Jul 12, 2006
Posts: 135
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,<br />-Rancy
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 10033

Is it container dependend or is it according to the servlet specs?
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Not the servlet spec, but the HTTP spec. RFC 2616 (the HTTP 1.1 spec), Section 5.1.1 has this to say:
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;
I agree. Here's the link:
Similar Threads
It's not a secret anymore!