This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes RequestDispatcher doubt 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 doubt" Watch "RequestDispatcher doubt" New topic
Author

RequestDispatcher doubt

Lalit mishra
Ranch Hand

Joined: Sep 01, 2005
Posts: 99


Consider the following code snippets. What will be displayed on the browser when a GET request is sent to FirstServlet assuming that the buffer is large enough to hold all the data before sending the data to the client?


what will be the output of following code
Vepa Sritej
Ranch Hand

Joined: Jul 31, 2006
Posts: 42
I guess Page 2 will be displayed , the buffer from the first servlet will be cleared..


tej<br /> <br />SCJP 1.5 --75%<br />SCWCD --89%<br />SCBCD/Web Services!! Yet to Decide
Charles Lyons
Author
Ranch Hand

Joined: Mar 27, 2003
Posts: 836
Yes it should be just "<br>Page 2</body></html>" - you might find this other thread useful:

What is allowed after forward()?


Charles Lyons (SCJP 1.4, April 2003; SCJP 5, Dec 2006; SCWCD 1.4b, April 2004)
Author of OCEJWCD Study Companion for Oracle Exam 1Z0-899 (ISBN 0955160340 / Amazon Amazon UK )
Michael Ku
Ranch Hand

Joined: Apr 20, 2002
Posts: 510
RequestDispatcher rd = response.getRequestDispatcher("SecondServlet");



You cannot get a RequestDispatcher from a response...
 
GeeCON Prague 2014
 
subject: RequestDispatcher doubt