< html > < body> I am in parent< %@include file="child.jsp" %>< /br> < /body> < /html >
File: child.jsp
I am in Included page...
So when we hit parent.jsp, all the content which is in child.jsp should be copied to page.jsp and it will be compiled. After compiling parent.jsp, if any changes happen in child.jsp will not be displayed until when the parent.jsp is getting recompiled.
When I tried the same, but I was getting a different output, after compiling my parent.jsp and if I make any changes to my child.jsp Tomcat 6 recompiles my parent.jsp again and I was getting the updated changes in child.jsp in the output.
I was searching this topic and found that some of the advance container is friendly and they check if any @included pages are getting updated when a request comes to main (parent.jsp) file. If that so then they recompiling the parent page again. Finally it really important that this scenario was NOT GUARANTEED BY THE SPEC!
Why they do?
* If they containers are doing this (container may thing they are friendly with us), then what’s the difference between @include and
1 comment:
It may not be so inefficient to keep track of the parent child relation by the container, each time it compiles any jsp. So, it is not really scanning the parent JSP file each time. It may be keeping track of each jsp which is used as a child in other jsp. It may simply be keeping a map of parents for any jsp and so can trigger the compilation of parent.
Post a Comment