File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes HTTP method GET is not supported by this URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "HTTP method GET is not supported by this URL" Watch "HTTP method GET is not supported by this URL" New topic
Author

HTTP method GET is not supported by this URL

Stephen Selvaraj
Greenhorn

Joined: Jan 21, 2005
Posts: 21
Hi all
i m using Tomcat5.0, i m tryin to run a sample servlet.
when i typin the url i get the following status
"HTTP method GET is not supported by this URL"
I have both the doGet and doPost method done..
Pls have a look at my code snippet and guide if i m wrong..

many thanx in advance
java nut!

public class TestServlet extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
System.out.println("Inside TestServlet"); request.getRequestDispatcher("/jsp/welcome.jsp").forward(request, response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
doGet(request,response);
}

}

web.xml
-------
<servlet>
<servlet-name>TestServlet</servlet-name>
<servlet-class>com.mymail.TestServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/TestServlet</url-pattern>
</servlet-mapping>
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

That should be working.

Did you have both methods in the servlet from the beginning?
If not, stop Tomcat, delete the class file, re-compile, and try again.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP method GET is not supported by this URL