Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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 Software Craftsman this week in the Agile 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.

Have you tried LearnNowOnline?
subject: absolute or relative