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

Doubt regarding flush attribute in jsp include action

 
rinki goyal
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

In JSP2.0 specification, regarding the "flush" attribute of "JSP:inlcude" action,
default flush is false.
If flush is set to true, then the buffer is flushed before the inclusion.
I am having two jsp's test1.jsp and test2.jsp.

In test1.jsp, i am including the test2.jsp using:
hello this is test1 jsp
<jsp:include page="test2.jsp" flush="true" />

and test2.jsp is having code :
hello this is test2 jsp -------------

<%
try{
throw new Exception("SDfdsfsd");
}catch(Exception e){
throw e;
}

%>


but out put is :
hello this is test1 jsp
hello this is test2 jsp -------------

irrespective of flush attribute's value.

Please clarify doubt regarding flush attribute value.
[ January 16, 2008: Message edited by: rinki goyal ]
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's really no point in catching that exception if all you're going to do is rethrow it.

The results you're claiming don't seem right. I tested it myself just to see.

When I set flush to true, I get the text from the first test page... or at least all the text that precedes the jsp:include. The stack trace only appears in my console.

When I set flush to false, the stack trace appears in both my console and my browser.

If you are using IE, make sure that you aren't getting a cached version of the page. If you use the refresh button (hotkey of F5), it should hit your server instead of using a cached version.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic