Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!

Surinder Singh

Greenhorn
+ Follow
since May 04, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Surinder Singh

you can pass a relative path to the getRequestDispatcher() method of ServletRequest but not to the getRequestDispatcher() method of ServletContext .

For example,
request.getRequestDispatcher("../html/copyright.html") is valid,and the getRequestDispatcher() method of ServletRequest will evaluate the path relative to the path of the request.

For the getRequestDispatcher()method of ServletContext, the path parameter cannot be relative and must start with /. This makes sense because ServletRequest has a current request path to evaluate the relative path while ServletContext does not.