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 taglibs?

484


Explain client-side and server-side validation.

478


Explain the jsp implicit objects?

520


Which attribute specifies a jsp page that should process any exceptions thrown but not caught in the current page? : Citibank

514


What is difference between page and pagecontext in jsp?

473






What are jsp and servlets?

478


Why does _jspService() start with an ‘_’ but other lifecycle methods do not?

531


Explain jsp?

542


What is the standard action?

517


List out the various scope values of jsp action.

590


What is the difference between hide comment and output comment?

1227


Which jsp methods can be overridden?

516


Which attribute specifies a jsp page that should process any exceptions thrown but not caught in the current page?

565


How do you connect to the database from jsp?

540


What is action tag in jsp?

492