File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RequestDispatcher doubt