• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference in @include file and jsp: include page

 
Zhixiong Pan
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Still I am not quite clear the difference between the @include file and jsp: include page, could you explain it?
 
Collins Mbianda
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Zhixiong !!!

<%@ include file="myPage.jsp" %>: The include directive include "myPage.jsp" at compile time
<jsp:include page="myPage.jsp" />: The include standard action will included "myPage.jsp" at request time(runtime).

The first way is a static include, and the second is a dynamic.
Hope it help.
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The @include is goes on the translation time, the jsp:include is goes on the run time. With @include you just include some text in your jsp, that's why it have an attribute file.
With jsp:include you can include the result from a page, that's why it has an attribute page.

Regards
M
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic