which situation you use static include and dynamic include
in jsp?

Answer Posted / sreekanth madamanchi

This is Static include.
<%@ include file="header.jsp" %>
1.the file includes static text. i.e if we use the static
include, it will merge the contents of included jsp
(header.jsp) with main jsp at compile time. and the size of
the main jsp will increase. some times it may have problem,
because the maximum size of the jsp is 64kb.
2.if the file is changed,the JSP engine may not recompile
the JSP

This is Dynamic include.
<jsp:include page="header.jsp">
1.The file includes Dynamically. i.e at run time.
2.If the included file (header.jsp) is changed,the JSP
engine recompile the included JSP, because it will include
at run time.By using this the jsp size also not increased.
For Example
Static include (<%@ include file="header.jsp" %>) like our
#include (C++)
Dynamic include (<jsp:include page="header.jsp"> ) like our
import (JAVA)

Is This Answer Correct ?    46 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is tag file?

497


What do you mean by custom tag in jsp?

516


How do we print “
creates a new line in html” in jsp?

671


What are scripting elements?

543


How many messaging models do jms provide for and what are they?

542






How many tags are there in jsp?

494


What is jsp net?

518


What is dynamic web project?

508


What is difference between html and jsp?

503


Is jsp front end or backend?

502


What is jsp application?

498


What is a jsp and what is it used for?

532


How can I use the results of my method? ea: <%! method (int x) { stuff return y; } %> <% out.println(y); %> how can I make this work? "y" is a variable made during the method.

1647


What is expression language injection?

506


Can I stop jsp execution while in the midst of processing a request?

557