File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Using getNamedDispatcher() to forward a request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Using getNamedDispatcher() to forward a request" Watch "Using getNamedDispatcher() to forward a request" New topic
Author

Using getNamedDispatcher() to forward a request

Jay Shukla
Ranch Hand

Joined: Jun 08, 2008
Posts: 214
Hi All, I'm just trying to forward my request using getNamedDispatcher() method.
And i lerant that "You do not need to include any servlet-mapping element for the target servlet if you are using getNamedDispatcher() method.

I have two class named "Controller.java" and Weather.java" (Forwarding Taget class)

Controller.java
=========


Weather.java
=========



web.xml
======



I'm using URL: http://localhost/Ch03/controller?go=weather to run the application.

But i;m getting following on the screen.


HTTP Status 405 - GET method is not supported by this URL

What could be the reason of above error message?
How this could be resolved?

Please Help.
Thanks in Advance.
PavanPL KalyanK
Ranch Hand

Joined: Feb 28, 2009
Posts: 212
what is goGet() in your weather servlet ?
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
The HttpServlet class doesn't have a goGet() method at all.
Read the API what methods are available: javax.servlet.http.HttpServlet.
Jay Shukla
Ranch Hand

Joined: Jun 08, 2008
Posts: 214
Oh my Bad!!!

Thanks Bauke for pointing my printing mistake. I should be doGet.

Thanks a Lot.
 
 
subject: Using getNamedDispatcher() to forward a request
 
Similar Threads
Authentication, again [not solved yet]
Not Getting proper output for Servlet Application
Tomcat problem
servlet programming problem in Eclipse
RequestDispatcher.forward problem