aspose file tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes jsp:forward Vs requestDispatcher.forward() Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "jsp:forward Vs requestDispatcher.forward()" Watch "jsp:forward Vs requestDispatcher.forward()" New topic
Author

jsp:forward Vs requestDispatcher.forward()

Sagar kanchi
Ranch Hand

Joined: Oct 07, 2005
Posts: 50
Hi,
While I was going through the SCWCD hints provided in javaranch website I came across the following stmt.

A <jsp:forward> effectively terminates the current page. Nothing before the <jsp:forward> or after the <jsp:forward> is written to the response! It is not the same when using a requestDispatcher.forward().

Can anybody explain how both forwards are different and in what aspects?
If it is already explained can somebody guide me to the URL where it is already explained.

Thnx in advance


Where there are more wonders there is less knowledge
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8795

The only difference between the two is that with <jsp:forward>, your control comes out of the _jspservice() method. But it is not the case with RequestDispatcher.forward() where your control is still within the service() method.


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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp:forward Vs requestDispatcher.forward()
 
Similar Threads
RequestDispatcher forward doubt?
errors on javaranch scwcd hints page?
SCWCD hints
scwcd doubt on jsp:forward
Ilegal State Exception