aspose file tools*
The moose likes Servlets 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
JavaRanch » Java Forums » Java » Servlets
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

Sherif Mahmoud
Greenhorn

Joined: Jun 01, 2007
Posts: 7
Hi,

I was doing the example in Head First Servlets and JSP of context listener.

Here is the servlet class:

public class ListenerTester extends HttpServlet {

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.setContentType("text/html");
PrintWriter out=resp.getWriter();

out.println("test context attributes set by listener <br>");
out.println("<br>");

Dog dog=(Dog)getServletContext().getAttribute("dog");

out.println("Dog's breed is: "+dog.getBreed());
super.doGet(req, resp);
}

}

Although the doGet is implemented I keep getting HTTP method GET is not supported by this URL from FireFox.

can anybody tell me what can be wrong.

Thanks,

Sherif
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Post the URL you are trying to access.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Sherif Mahmoud
Greenhorn

Joined: Jun 01, 2007
Posts: 7
Thanks for your reply. I found that I had a problem with my class files location under the application directory under webapps. That caused errors during the servlet startup. I got it working now.

Thanks,

Sherif
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP method GET is not supported by this URL