• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp:include and @include which complied first?

 
umar hathab
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..
I have one jsp page which has one page include and jsp:include..I know that the source code of page included page will be inserted into main jsp and compiled..My question is which page will be compiled first..whether its the outer main jsp or jsp:included page..?

The code may looks as below..
Main.jsp:
=================================================
<%@ page import="java.util.ArrayList" %>
<% String strName="Umar"; %>

<%@ include file="inner1.jsp" %>
<jsp:include page="inner2.jsp" />
=================================================
I also want to know how many servlets will be created by the container for this page Main.jsp..
Thanks in Advance.
A.Umar
 
Anthony Villanueva
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will have two servlets. The include directive will instruct the container to inline the content of inner1.jsp to main.jsp. The include action will only compile inner2.jsp at runtime.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic