Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

About Flush Before Include/forward

 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I have a code

case:1 with <jsp:forward>
-------------------------
<%
out.println("Before forward/include");
out.flush();
%>
<jsp:forward page="test.html" />

<%
out.println("After forward/include");
%>

a)Container throws Exception
b)output displayed => Before forward/include.


case2:: <jsp:include>
------

<%
out.println("Before forward/include");
out.flush();
%>
<jsp:include page="test.html" />

<%
out.println("After forward/include");
%>

a)container will not throw exception
b)it will deisplay
Before forward/include
include test.html
After forward/include


It means in <jsp:include> if we commit the response and then we will include then it doesn't make difference.


Please correct me if i'm wrong ???

sanjay
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi sanjay,
if you have already comitted *A* response,
your app is death no ... for... ;-). You are over.
if you deploy your examples:
this is the answer:
IllegalStateException.
commitDeath,
ser
 
Sanjay pts
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But i think its of

response.sendRedirect(String URL)
and
RequestDispatcher.forward().

but not for
RequestDispatcher.include()
or<jsp:include page="" />

Please correct me if im wrong

Thanx
sanjay
 
reply
    Bookmark Topic Watch Topic
  • New Topic