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
Give an example of using your own tags.
What are jsp implicit objects?
How can automatic creation of session be prevented in a jsp page?
What is jstl (jsp standard tag library)?
What are the scopes available in
How do we prevent browser from caching output of my jsp pages?
What are directives in jsp?
What is a page directive?
What is jsp action tags?
What are directives? What are the different types of directives available in jsp?
How can the output of JSP or servlet page be prevented from being cached by the browser?
How to ignore the el expression evaluation in a jsp?
How can we stop errors on display in a jsp page?
What are the steps involved in reading data from a form using jsp?
Can we use javascript in jsp?