Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

include differences

 
Al Korov
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%@ include file="fubar.jsp" %>

<jsp:include page="fubar.jsp" />

I'm not clear on what the differences between these two are.

Does it relate to scope (page, request, session, or application) access?
 
Purushoth Thambu
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<jsp:include> is like a function call. The control is transfered to the page mentioned in the jsp:include tag i.e fubar.jsp. This page is processed and the result gets included in the called page out stream.

<@include> inserts the content of the file mentioned to the current page. <@include> is ideally executed before processing the page.
 
Al Korov
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the reply.

You wrote, "<@include> is ideally executed before processing the page."

What do you mean by "ideally executed before"?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%@include> - is used to include text, code at translation time of a jsp.
<jsp:include> - including resources during runtime.

i think it would be more clear now.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "ideally executed before"?


I have no idea what that was suppoed to mean.

The include directive is evaluated at JSP translation time.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!