File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "SC_METHOD_NOT_ALLOWED" Watch "SC_METHOD_NOT_ALLOWED" New topic
Author

SC_METHOD_NOT_ALLOWED

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9629
    
    2

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?


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: 9629
    
    2

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,
-Rancy


Thanks,<br />-Rancy
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9629
    
    2

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

Joined: Mar 22, 2005
Posts: 42950
    
  70
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;
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SC_METHOD_NOT_ALLOWED
 
Similar Threads