Hi,
can anybody tell me the difference of requestDispatcher.forward() and requestDispatcher.include()?
and where to use which one ?
thanks in advance.
dipes.
dipes.biswas@wipro.com
Discussions
Web tier: servlets, JSP, Web frameworks: difference between forward() and include of requestDispatcher ?
-
difference between forward() and include of requestDispatcher ? (4 messages)
- Posted by: Dipes Biswas
- Posted on: November 22 2000 08:22 EST
Threaded Messages (4)
- difference between forward() and include of requestDispatcher ? by Kapil Israni on November 22 2000 10:19 EST
- difference between forward() and include of requestDispatcher ? by Dipes Biswas on November 22 2000 23:31 EST
-
one doubt !! by saurabh agarwal on May 16 2008 02:22 EDT
- ! by Guru Prasad on April 08 2010 12:06 EDT
-
one doubt !! by saurabh agarwal on May 16 2008 02:22 EDT
- difference between forward() and include of requestDispatcher ? by Dipes Biswas on November 22 2000 23:31 EST
-
difference between forward() and include of requestDispatcher ?[ Go to top ]
- Posted by: Kapil Israni
- Posted on: November 22 2000 10:19 EST
- in response to Dipes Biswas
hi dipes,
will difference is in their name itself.
forward is used to forward a request, that is control is transfered to the new servler/jsp. u shud take care to not put any our.println() statements in the servlet from where u plan to call forward method. in fact u cant even fire response.getWriter() method in this case. u can only do that in the servlet to which the control is bein fwded
include - means that the new servlet/jsp will be procesed and any out.println()/html stuff will be included and then control will come back to the servlet/jsp that called include method.
hope this helps
kapil -
difference between forward() and include of requestDispatcher ?[ Go to top ]
- Posted by: Dipes Biswas
- Posted on: November 22 2000 23:31 EST
- in response to Kapil Israni
Thanks Kapil.
Yes, this is all I wanted. -
one doubt !![ Go to top ]
- Posted by: saurabh agarwal
- Posted on: May 16 2008 02:22 EDT
- in response to Dipes Biswas
but does this mean that forward () does not send control back to this current servlet(where we hav executed our forward call) after procesing jsp/class. ?? -
![ Go to top ]
- Posted by: Guru Prasad
- Posted on: April 08 2010 00:06 EDT
- in response to saurabh agarwal
but does this mean that forward ()
does not send control back to this current servlet(where we hav executed our forward call) after procesing jsp/class. ??
Dude, that is not possible, it's java after all. Control will comeback but it just means that you cannot modify the stream.
Guru