Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTP method GET is not supported by this URL

 
Sherif Mahmoud
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post the URL you are trying to access.
 
Sherif Mahmoud
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic