• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jsp:forward

 
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
anyone else? tks.
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
expectation is the root of all heartache - shakespeare. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic