File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes method POST not allowed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "method POST not allowed" Watch "method POST not allowed" New topic

method POST not allowed


Joined: Jul 22, 2001
Posts: 8
I am having trouble running a servlet(.class) I wrote. If I put itin the path specified by alias in the tomcat-apache.conf file or in the active directory I get the error
the requested method POST not allowed for the URL /examples/Rot13.class
I have restarted both apache and tomcat several times.
Do I have to include a reference to the class file in the Web.xml file? If so where can I get instruction on how to do so?
anyhelp would be greatly appreciated,
Beksy Kurian
Ranch Hand

Joined: Jul 11, 2001
Posts: 254
Aren't you putting the classes in the
WEB-IF/classes directory?
URL for tomcat docs
Sam Dalton
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
Silly question I know but does you servlet actually have a doPost (or service) method? This is a common problem of posting to servlets that only implement the doGet method...

<a href="" target="_blank" rel="nofollow">Sam Dalton</a>,<br />Co-author of []Professional JSP 2.0[/URL] (October 2003)<br />Co-author of <a href="" target="_blank" rel="nofollow">Professional SCWCD Certification</a><br />Co-author of <a href="" target="_blank" rel="nofollow">Professional Java Servlets 2.3</a>
I agree. Here's the link:
subject: method POST not allowed
jQuery in Action, 3rd edition