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
Explain the various scope values for
What is jsp in html?
What are the different life-cycle methods?
HOW CAN WE COMPARE TWO PDF FILES USING JSP ?
Why jsp is better over static html also explain lifecycle of a jsp?
Can jsp run without server?
What are the primary differences between the jsp custom tags and java beans?
What program opens a jsp file?
Give a sample jsp configuration in the deployment descriptor.
How is jsp better than servlet technology?
What is a tag file?
What are the different types of directives available in jsp?
What are the different types scripting elements in jsp?
What is the requirement of a tag library?
How can I declare methods within my jsp page?