This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
 
 
subject: HTTP method GET is not supported by this URL
 
Similar Threads
When HttpSessionAttributeListener and HttpSessionBindingListener methods are called?
ListenerTester
flush() before RequestDispatcher
HTTP error 405
Confused with flush() behavior