This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using getNamedDispatcher() to forward a request

 
Jay Shukla
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is goGet() in your weather servlet ?
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh my Bad!!!

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

Thanks a Lot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic