• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp:forward

 
Steven Colley
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,could you please help me with this question?

i marked the option "5". is that correct?

Tks.

Given that the JspWriter's buffer will NOT be flushed until the end of the JSP page has been reached, where does the above code appear within a JSP document?

Choice 1 - Before any directives
Choice 2 - Anywhere within the document
Choice 3 - Only on the very first line of the document
Choice 4 - Before any declarations
Choice 5 - Only before any scriptlets that write output to the response object

Tks.
 
Gab Buda
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you forgot to give us the "above code" to analyse...
 
Steven Colley
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gabb, yes. Tks.

But it�s about "<jsp:forward... />"

tks.
 
Steven Colley
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anyone else? tks.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

What is the answer given. My answer is 2. As the response is not commited (buffer is not flushed) anywhere in the page the forward action occurs, the response is cleared and the forward action is invoked.

Thanks
 
singh santosh
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,
According to me the 2 option shuld be the correct one .
Whenever forwad happens the buffer is cleared and response object stats anew for the forwared jsp.
Writing to the response is not prohibited before calling jsp:forward as this will not commit resonse to the client(flush does commit the response )
So u could use jsp:forward anywhere before commiting the response(in this case flushing the outputstream does commit the response)

Regards
-santosh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic