Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Significance of Flush in <jsp:include ?

 
Veena Pointi
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
Vaib Gupta
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.I understood . Explanation was very clear.Thank you very much.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic