File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes what is the difference b/w forward() and include() in RequestDispatcher Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "what is the difference b/w forward() and include() in RequestDispatcher" Watch "what is the difference b/w forward() and include() in RequestDispatcher" New topic
Author

what is the difference b/w forward() and include() in RequestDispatcher

Dhineshkumar raj
Greenhorn

Joined: Aug 06, 2007
Posts: 28
what is the difference b/w forward() and include() methods in RequestDispatcher class

Can any one tell me the clear definition an differences

DhineshKumar R
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

forward () is used to forward the page to another page that you specify, with the same set of request and response references, whereas an include () includes the content of the page that you want to include.

what is not clear here?


SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
vidyasagar sree
Greenhorn

Joined: Mar 07, 2008
Posts: 1
Originally posted by Dhineshkumar raj:
what is the difference b/w forward() and include() methods in RequestDispatcher class

Can any one tell me the clear definition an differences

DhineshKumar R


in forward: if request and response transfer from one page to another, it will not return to previous page.
in include:if request and response transfer from one page to another, it will return to previous page by taking all information from second page .


regards<br />vidyasagar
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1506
This topic has been "beaten to death" here. Search the forums. You will find lots of discussion on it. It's also in the FAQ I think.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what is the difference b/w forward() and include() in RequestDispatcher
 
Similar Threads
Request
what is requestDispatcher
forward() VS include()
Diff btw response.sendRedirect, jsp:forward and RequestDispatch .forward methods?
forward and include of RequestDispatcher