wood burning stoves*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes RequestDispatcher Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "RequestDispatcher" Watch "RequestDispatcher" New topic
Author

RequestDispatcher

Sharma Anjali
Ranch Hand

Joined: Feb 22, 2005
Posts: 63
JQPLus
Ques ID: 1074483088810

Which of the following statements is correct regarding a RequestDispatcher?

Ans
The execution control returns to the resource that has called the forward() method after the callee resource finishes processing.

Explanation
RequestDispatcher.forward() is also a normal method call, so the control does return to the calling resource

Is this correct? Doesn't forward means go to the next resource ?
Rohit Bhagwat
Ranch Hand

Joined: Dec 19, 2004
Posts: 205
Hi Anjali

Nice question

Forward is a normal method so the control does comes back to the caller.

However the control also goes to the forwarded resource for processing..

But if you write to response something after forward then it will be ignored because the response gets commited after the control returns. So it will give IllegalStateException.

Regards
Rohit
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RequestDispatcher