jsp:include標籤與include指令的區別

來源:互聯網
上載者:User

標籤:lse   儲存   訪問   運行時   content   文法   運行   title   include指令   

<!-- 把a。jsp和b。jsp包含到index。jsp裡面一起編譯,靜態包含,先包含在編譯 -->

而用include指令負載檔案時,是將負載檔案和Jsp頁面合并成一個新的Jsp頁面後,發送給Jsp引擎進行處理的,因此如果負載檔案發生變化,則必須要將Jsp頁面重新儲存,然後再次訪問,使其轉譯成Java檔案,才能看到改變後的結果
<!--<%@include file="a.jsp" %> -->
<!--<%@include file="b.jsp" %> 11-->
<!-- 動態包含 先編譯在包含 -->

.jsp:include標籤是在執行時才對載入的檔案進行處理,因此Jsp頁面和它所載入的檔案在邏輯和文法上都是獨立的,如果對負載檔案進行修改,那麼運行時可以看到所負載檔案修改後的結果
<!-- <jsp:include page="a.jsp" flush="true"></jsp:include> -->
<!-- <jsp:include page="b.jsp" flush="false"></jsp:include> -->

 

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
a.jsp

</body>
</html>

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
b.jsp

</body>
</html>

jsp:include標籤與include指令的區別

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.