• 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

Significance of Flush in <jsp:include ?

 
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the significance of Flush attribute in <jsp:include

I tried following code main.jsp



Output is always same irrespective of weather flush is true or false.

Welcome to Main Page
Including Header Inside Header
End of Main Page

Can anybody please explain or give me an example where I can understand flush attribute properly?

Thanks
Veena
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What part of the the explanation in the JSP Specification was not clear to you? I think it's rather clearly worded.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a very simple example here. Make two jsps, for instance DemoFlush.jsp and errorProne.jsp. DemoFlush.jsp code goes like this:

<html>
<body>
Some text here
<jsp:include page="errorProne.jsp" flush="true"/>
</body>
</html>

errorProne.jsp code is like this:

<%= 0/0%>

When you access the page DemoFlush.jsp with flush attribute set to true, you'll be able to see the "Some text here" text. However if flush is set to false, you will get an exception. So in a way before including the page, flush attribute writes the code of the included page in the response. I hope this clears some doubts...
 
Veena Pointi
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes.I understood . Explanation was very clear.Thank you very much.
 
Their achilles heel is the noogie! Give them noogies tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic