This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes absolute or relative Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "absolute or relative" Watch "absolute or relative" New topic

absolute or relative

suman deb
Ranch Hand

Joined: Jul 14, 2005
Posts: 54
What URL (absolute or relative) is used in RequestDispatcher forward ?
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

that depends on whether you give a relative or absolute reference to the resource.
Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
With the RequestDispatcher, "absolute" is really relative to your web application root. If its the ServletContext's RequestDispatcher, you have to use absolute. With the request's RequestDispatcher you can use relative to the request URI if you leave out the "/" at the beginning.

I agree. Here's the link:
subject: absolute or relative