• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

request and translation time including

 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just want to make sure that I am correct.
Please, read:

Translation time include:
<%@ include file="" %>

<directive:include.file = "" />

Request time include:

<jsp:include page="" flush="" /> [flushing depends on "flush" attribute]

<% pageContext.include(...); %> [always flushes the output of the current page before including the other component]

<% getServletContext().getRequestDispatcher(/...).include(...); %> [always flushes the output of the current page before including the other component]

<% request.getRequestDispatcher(...).include(...) %> [always flushes the output of the current page before including the other component]

Any other ways of including? Please verify.
 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lucas Smith wrote:I just want to make sure that I am correct.
Please, read:
<directive:include.file = "" />


i didn't understand this one i think it should be


avi sinha
 
Ankit Garg
Sheriff
Posts: 9580
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<% getServletContext().getRequestDispatcher(/...).include(...); %> [always flushes the output of the current page before including the other component]

Where did you find this?? I cannot find anywhere in the spec or documentation that include method flushes the output before the include...
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
avi: it's XML view and You are right, your version is good!
Ankit: http://www.ucertify.com/article/differentiate-between-pagecontextinclude-and-jspinclude.html
 
Ankit Garg
Sheriff
Posts: 9580
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lucas, the link you gave is about pageContext.include, I'm talking about RequestDispatcher.include. The documentation of PageContext.include method states that the buffer will be flushed, but nothing as such is given for RequestDispatcher.include...
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what about that:
http://www.coderanch.com/t/466924/Web-Component-Certification-SCWCD/certification/pageContext-include;jsessionid=82B172AD7F9BC89A79B4CF976282F6F1

EDIT:
Well, I see. RequestDispatcher.include() doesn't use JSP buffer ;)
pageContext.include flushes the buffer and RequestDispatcher.include() doesn't need it
 
Ankit Garg
Sheriff
Posts: 9580
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The thread clearly indicates that the RequestDispatcher.include method doesn't flush the output of the current page before doing the include. That's why the behavior was observed. RequestDispatcher.include directly writes to the output stream without flushing the buffer, it doesn't even use the buffer at all...

Edit: Wrote this before Lucas edited his post, so not of much use now
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevertheless, thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic