Browse Today's favorites or All time favorites.
Please Sign In or Register to share and submit your questions.
Java Queries
Complete java interview questions library
What are the differences between static and a dynamic include?
Static include <%@ include %> :
During the translation or compilation phase all the included JSP pages are compiled into a single Servlet.
Dynamic include <jsp:include …..>:
The dynamically included JSP is compiled into a separate Servlet. It is a separate resource, which gets to process the request, and the content generated by this resource is included in the JSP response.
Use “static includes” when a JSP page does not change very often. For the pages, which change frequently, use dynamic includes. JVM has a 64kb limit on the size of the method and the entire JSP page is rendered as a single method. If a JSP page is greater than 64kb, this probably indicates poor implementation. When this method reaches its limit of 64kb it throws an error. This error can be overcome by splitting the JSP files and including them dynamically (i.e. using <jsp:include…….>) because the dynamic includes generate separate JSP Servlet for each included file.
Write a comment