JSP静态包含与动态包含

<%@ include file=”要包含的文件”%> 静态包含 先包含,后编译处理;
<jsp:include page=”要包含的文件”> 动态包含 先编译处理,后包含;

静态包含

<h1>静态包含</h1>
<%@ include file="common/head.html" %>
<p>content</p>
<%@ include file="common/footer.jsp" %>

动态包含

<h1>动态包含</h1>
<jsp:include page="common/head.html"/>
<p>content</p>
<jsp:include page="common/footer.jsp"/>

猜你喜欢

转载自blog.csdn.net/weixin_39051908/article/details/81014834