<%@ include file="" %>和的区别

 <%@ include file="" %>和<jsp:include page="" />的区别

<%@ include file="" %>
    静态包含文件,即在编译时插入包含的文件。file不能为一变量URL,也不可以在file 所指定的文件后接任何参数,file 所指的路径必须是相对于此JSP 网页的路径。
如果在includebydirectives.jsp中使用<%@ include file="common.jsp"%>,则会在生成的includebydirectives_jsp.java中将common.jsp的文件包含进来。
注:在common.jsp、includebydirectives.jsp可相互引用定义的变量、方法。在common.jsp中定义的指令会合并到includebydirectives.jsp中。
<jsp:include page="" />
     动态包含文件,即在运行时加入包含文件的运行结果。语法:
<jsp:include page="{urlSpec | <%= expression %>}" flush="true | false " />

<jsp:include page="{urlSpec | <%= expression %>}" flush="true | false" >
<jsp:param name="PN" value="{PV | <%= expression %>}" /> *
</jsp:include>
如果在includebyaction.jsp中使用<jsp:include flush="true" page="common.jsp"></jsp:include>,则在生成的includebyaction_jsp.java中在include的地方会加入一条:
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "common.jsp", out, true);
注:includebyaction.jsp和common.jsp是相互独立的,includebyaction.jsp只是把common.jsp执行的结果加入。

<%@ include file="" %>和<jsp:include page="" />的区别,布布扣,bubuko.com

<%@ include file="" %>和<jsp:include page="" />的区别

上一篇:VMware中卸载安装Ubuntu系统 ——Ubuntu系统配置(一)


下一篇:emacs配置wakatime