<% include file="target.jsp" %>
will inline the source of target.jsp
into your page, and then the whole thing will then be evaluated as a single JSP. This is done at JSP compile time. This can be highly optimized by the container, and can have side-effects. For example, if you change the content of target.jsp
, the container generally will not recompile the JSPs that included it.
<jsp:include page="target.jsp"/
> will execute target.jsp
as a seperate JSP, and then include the output of that execution into your page. This is done at JSP execution time. Note that this can refer to any path inside the container, not just a JSP (e.g. you can include the output of a servlet).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…