<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # JSP `include`動作標簽 > 原文: [https://beginnersbook.com/2013/11/jsp-include-action-tag/](https://beginnersbook.com/2013/11/jsp-include-action-tag/) `Include`動作標簽用于將另一個資源包含到當前 JSP 頁面。包含的資源可以是 HTML,JSP 頁面或 Servlet 中的靜態頁面。我們還可以將參數及其值傳遞給我們所包含的資源。下面我分享了兩個`<jsp:include>`的示例,其中一個包含一個頁面而沒有傳遞任何參數,在第二個示例中,我們將幾個參數傳遞給正在包含的頁面。 **語法:** 1)包含參數。 ```html <jsp:include page="Relative_URL_Of_Page"> <jsp:param ... /> <jsp:param ... /> <jsp:param ... /> ... <jsp:param ... /> </jsp:include> ``` 2)包含另一個沒有共享參數的資源。 ```html <jsp:include page="Relative_URL_of_Page" /> ``` 如果頁面位于當前 JSP 所在的同一目錄中,`Relative_URL_of_Page`將是頁面名稱。 ### 示例 1:沒有參數的`<jsp:include>` 在這個例子中,我們將使用沒有參數的`<jsp:include>`動作標簽。因此,頁面將包含在當前 JSP 頁面中: `index.jsp` ```html <html> <head> <title>JSP Include example</title> </head> <body> <b>index.jsp Page</b><br> <jsp:include page="Page2.jsp" /> </body> </html> ``` `Page2.jsp` ```html <b>Page2.jsp</b><br> <i> This is the content of Page2.jsp page</i> ``` **輸出:** `Page2.jsp`的內容已附加在`index.jsp`中。 ![IncludeAction-output](https://img.kancloud.cn/0b/51/0b5129662c3cba0f9fe62f37a4633c04_503x263.jpg) ### 示例 2:使用`<jsp:include>`以及`<jsp:param>` `index.jsp` 我正在使用`<jsp:include>`和`<jsp:param>`動作,將參數傳遞給我們將要包含的頁面。 ```html <html> <head> <title>JSP Include example with parameters</title> </head> <body> <h2>This is index.jsp Page</h2> <jsp:include page="display.jsp"> <jsp:param name="userid" value="Chaitanya" /> <jsp:param name="password" value="Chaitanya" /> <jsp:param name="name" value="Chaitanya Pratap Singh" /> <jsp:param name="age" value="27" /> </jsp:include> </body> </html> ``` `display.jsp` ```html <html> <head> <title>Display Page</title> </head> <body> <h2>Hello this is a display.jsp Page</h2> UserID: <%=request.getParameter("userid") %><br> Password is: <%=request.getParameter("password") %><br> User Name: <%=request.getParameter("name") %><br> Age: <%=request.getParameter("age") %> </body> </html> ``` **輸出:** 正如您所看到的,`display.jsp`的內容已包含在`index.jsp`中。此外,我們傳遞的參數正在包含的頁面中正確顯示。 ![include-action-with-parameters-output](https://img.kancloud.cn/bd/c8/bdc8665a8e1a4a4a2a78b09e77009c59_503x263.jpg) 如果您對該主題有任何疑問和疑問,請告訴我們。我們很樂意幫助您!!
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看