This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes RequestDispatcher Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "RequestDispatcher" Watch "RequestDispatcher" New topic
Author

RequestDispatcher

Saurabh Shah
Greenhorn

Joined: Jan 16, 2007
Posts: 2
What is the difference between
RequestDispatcher rd = request.getRequestDispatcher().forward();

and


RequestDispatcher rd = getServletContext.getRequestDispatcher().forward();
Rao Raghu
Ranch Hand

Joined: Jan 05, 2007
Posts: 100
rd of servletContext takes a path relative to the current servlet whereas that of request takes an absolute path i.e you have to provide complete path in case of rd of request type.


RAGHU<br /> <br />"When the going gets tough, the tough get going"
Saurabh Shah
Greenhorn

Joined: Jan 16, 2007
Posts: 2
Suppose i want to redirect to a page of another application .....
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Saurabh Shah:
Suppose i want to redirect to a page of another application .....


This has been discussed constantly in the last couple weeks.
Read some of the other posts on this subject.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
jQuery in Action, 2nd edition
 
subject: RequestDispatcher
 
Similar Threads
servlet sendRedirect()
RequestDispather
jsp page redirection
to do a forward in servelt
request.getRequestDispatcher