• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is the impact of changing the @include to <jsp:include> in our j2ee application

 
sumanta panda
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
For improve the J2ee performance of our application I found a point mentioned below.
Use the include directive <%@ include file="copyleft.html" %> where possible, as this is a compile-time directive (include action <jsp:include page="copyleft.jsp" /> is a runtime directive).

Our application is both using <%@ include file> and <jsp: include>.Even if I am not figure out the purpose why they used like.So I am thinking to replace <jsp:include> where they <%@ include file> used.
For example: <%@ include file="../fragments/invoicePopUpJs.jsp" %>
Changed to
<jsp:include file="../fragments/invoicePopUpJs.jsp"></jsp:include>

Please suggest me if I am wrong. Kindly let me know if we will change should it impact our application.

Thanks in advance.

Regards,
Sumanta Panda
 
Albareto McKenzie
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at this, it might be helpful:

http://faq.javaranch.com/view?IncludesActionDirective

 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Yes you read it right.

If your page not contains any dynamic content then it is better to use <%@ include file="copyleft.html" %> include directive.

But if your include page contains dynamic data then better to use Standard action <jsp:include ..../>

basically <jsp:include ..../> use to include the page response at run time so it takes time to compile ....

When inclide directive just copy the file contains and Past it on given location ......... So it is fast.... compare to <jsp:include ..../> standard action.




 
Albareto McKenzie
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use <jsp:include take care that the included jsp is other page, so if you have variables in your includer page are not passed to the included unless you explicitily pass them or they are not in the page scope. (I advise you because I had problems with this and I got crazy for a while)
 
sumanta panda
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to all for your time.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!