jsp param動作標籤

來源:互聯網
上載者:User

標籤:man   tracking   integer   bsp   log   code   ack   value   mil   

param 標籤以“名字-值”對的形式為其它標籤提供附加訊息。這個標籤與jsp:include、jsp:forward、jsp:plugin標籤一起使用。

param 動作標籤

<jsp:param name=“名字”value =“指定給param的值”/>

當該標籤與jsp:include標籤一起使用時。能夠將param標籤的值傳遞到include指令要載入的檔案裡去,因此include動作標籤假設結合param標籤。能夠在載入檔案的過程中向該檔案提供訊息。

以下這個範例是param.jsp

<%@ page contentType="text/html;charset=GB2312"%><HTML><BODY><p>載入檔案效果:    <jsp:include page="tom.jsp"><jsp:param name="computer" value="300"/></jsp:include></BODY></HTML>

以下是tom.jsp

<%@ page contentType="text/html;charset=GB2312"%><HTML><BODY><%      String str=request.getParameter("computer"); int n=Integer.parseInt(str); int sum=0; for(int i=1;i<=n;i++){      sum+=i; } %><p>從1到<%=n%>的連續和是:<BR><%=sum%></BODY></HTML>
執行效果:

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvZ3Vhbmp1bmdhbw==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" >

jsp param動作標籤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.