Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

requestDispatcher.forward() forgets path

 
Mike Nightsky
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Zeeshan Faisal
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic