aspose file tools*
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
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RequestDispatcher