what is the difference between @include page and @include file

Answers were Sorted based on User's Feedback



what is the difference between @include page and @include file..

Answer / alim atar

<jsp:include page="page.jsp" >
is action which include the output of page.jsp at
dyanamically.Instead of copying all content of page.jsp
Container transalte ,compiles page.jsp separtly and copy
the ouput of page.jsp to current page.It means it's
dyanamic inclusion.
<@include file="page.jsp">
it is directory which copy all content's of page.jsp to
current jsp page and then complete current page is
translated and compiled. It is static inclusion of file
which means copy all source code to current page as it is.

Is This Answer Correct ?    24 Yes 2 No

what is the difference between @include page and @include file..

Answer / satyanarayana

<jsp:include page="page.jsp" >
is action which include the output of page.jsp at
dyanamically.Instead of copying all content of page.jsp
Container transalte ,compiles page.jsp separtly and copy
the ouput of page.jsp to current page.It means it's
dyanamic inclusion.

In translation it will create only two servlet.

After inclusion if there any changes in source file will
reflect in jsp

it is evaluated with every request.



<@include file="page.jsp">
it is directory which copy all content's of page.jsp to
current jsp page and then complete current page is
translated and compiled. It is static inclusion of file
which means copy all source code to current page as it is.

In translation it will create only one servlet.

After inclusion any change in source file will not reflect
the jsp.
it is evaluated only once at translation time.

Is This Answer Correct ?    7 Yes 2 No

Post New Answer

More Core Java Interview Questions

What is the use of bin and lib in JDK?

8 Answers   TCS,


What is the purpose of file class?

0 Answers  


What will happen if non-synchronized method calls a static synchronized method and what kind of lock it acquires?

0 Answers  


What do you mean by light weight and heavy weight components?

0 Answers  


How can a gui component handle its own events in java programming?

0 Answers  






long d =10;int i =0;i=d; /// is this possible? If d is very long number (10 digits or some thing) then?

3 Answers  


what is polymorphism?

5 Answers   Zensar,


What are the two environment variables that must be set in order to run any java programs?

0 Answers  


What is the use of arrays tostring () in java?

0 Answers  


What is the default value of byte datatype in java?

0 Answers  


How many decimal places is a double?

0 Answers  


What is type conversion in java?

0 Answers  


Categories