• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Doubt regarding flush attribute in jsp include action

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic