<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 表達式標簽 > 原文: [https://beginnersbook.com/2013/11/jsp-expression-tag/](https://beginnersbook.com/2013/11/jsp-expression-tag/) 表達式標簽評估放置在其中的表達式,將結果轉換為`String`并通過[`response`對象](https://beginnersbook.com/2013/11/jsp-implicit-object-response-with-examples/ "Response implicit object")將結果發送回客戶端。基本上它將結果寫入客戶端(瀏覽器)。 **JSP 中表達式標簽的語法:** ```html <%= expression %> ``` ## JSP 表達式標簽示例 **例 1:值的表達式** 這里我們只是在表達式標簽內傳遞值的表達式。 ```html <html> <head> <title>JSP expression tag example1</title> </head> <body> <%= 2+4*5 %> </body> </html> ``` **輸出:** ![expression-tag-example1](https://img.kancloud.cn/b7/b9/b7b9850822abbd67327bb13d1d8c958d_364x145.jpg) **例 2:變量的表達式** 在這個例子中,我們初始化了幾個變量,并在表達式標簽中傳遞變量表達式以進行結果評估。 ```html <html> <head> <title>JSP expression tag example2</title> </head> <body> <% int a=10; int b=20; int c=30; %> <%= a+b+c %> </body> </html> ``` **輸出:** ![expression-tag-example2](https://img.kancloud.cn/cc/08/cc08411f66ae5a6746e37eecf0ed41a2_364x145.jpg) **示例 3:字符串和隱式對象輸出** 在此示例中,我們使用[`application`隱式對象](https://beginnersbook.com/2013/11/jsp-implicit-object-application-with-examples/ "Application object")設置屬性,然后使用表達式標簽在另一個 JSP 頁面上顯示該屬性和一個簡單字符串。 `index.jsp` ```html <html> <head> <title> JSP expression tag example3 </title> </head> <body> <% application.setAttribute("MyName", "Chaitanya"); %> <a href="display.jsp">Click here for display</a> </body> </html> ``` `display.jsp` ```html <html> <head> <title>Display Page</title> </head> <body> <%="This is a String" %><br> <%= application.getAttribute("MyName") %> </body> </html> ``` **輸出:** ![expression-tag-output1](https://img.kancloud.cn/57/4d/574d39dca7752c9b63e12d18b08d6280_443x186.jpg) ![expression-tag-output2](https://img.kancloud.cn/60/aa/60aaad370434792b0aaa4ea2e4a12b5d_443x186.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>

                              哎呀哎呀视频在线观看