• Post Reply Bookmark Topic Watch Topic
  • New Topic

RequestDispatcher doubt  RSS feed

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess Page 2 will be displayed , the buffer from the first servlet will be cleared..
 
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it should be just "<br>Page 2</body></html>" - you might find this other thread useful:

What is allowed after forward()?
 
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

RequestDispatcher rd = response.getRequestDispatcher("SecondServlet");




You cannot get a RequestDispatcher from a response...
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!