GeeCON Prague 2014*
The moose likes Servlets and the fly likes requestDispatcher.forward() forgets path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "requestDispatcher.forward() forgets path" Watch "requestDispatcher.forward() forgets path" New topic
Author

requestDispatcher.forward() forgets path

Mike Nightsky
Ranch Hand

Joined: Aug 18, 2001
Posts: 48
Is this suppoused to do or is this a bug in tomcat.
If i forward a request via the requestDispatcher the requestUri has changed to the parameter given to the requestdispatcher.

if it is suppoused to do it like that, is the original uri stored somewhere in the request, or have i put it into a parameter to keep it.

Mike


Win the opportunity to make money on the Internet<br /><a href="http://sweeps.sitesell.com/minirich.html" target="_blank" rel="nofollow">http://sweeps.sitesell.com/minirich.html</a>
Zeeshan Faisal
Greenhorn

Joined: Apr 21, 2004
Posts: 5
I think that there is some problem in the code that u wrote in ur application because there is no such bug in Tomcat. I have checked it
Mike Nightsky
Ranch Hand

Joined: Aug 18, 2001
Posts: 48
I forward the request to a servlet via the invokerservlet from tomcat.
If i look at the requestURI in the called servlet i get the path with which i called the Requestdispachter ("/servlet/com.company.servlet.DoSomething")
but i want the original path ("/company/something")

Mike
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12792
    
    5
You should not be using the invoker servlet for any serious work. See the JavaRanch FAQ on the subject of the invoker.
Your DoSomething servlet needs to be defined in web.xml with the URL you want the RequestDispatcher to recognize.
Bill
Mike Nightsky
Ranch Hand

Joined: Aug 18, 2001
Posts: 48
i have about 200 servlets and the number is growing.
i use the invoker because i dont want to stop and start the server if i add some functionallity.
 
GeeCON Prague 2014
 
subject: requestDispatcher.forward() forgets path