国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > JSP > 正文

JSP中使用JSTL按不同條件輸出內(nèi)容的方法

2020-07-27 21:30:26
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

本文實(shí)例講述了JSP中使用JSTL按不同條件輸出內(nèi)容的方法。分享給大家供大家參考。具體如下:

ConditionalContentJSTL.jsp頁(yè)面:

<%@ page language="java" contentType="text/html;charset=UTF-8" %><%@ taglib uri="/WEB-INF/tld/c-rt.tld" prefix="c-rt" %><html><head> <title>Java Code Geeks Snippets - Conditional Content with JSTL in JSP Page</title></head><body> <%-- if condition --%> <c-rt:if test='${param.myparam1 == "myvalue1"}'>  This is printed if parameter "myparam1" equals "myvalue1" </br> </c-rt:if> <%-- if/else condition --%> <c-rt:choose>  <c-rt:when test='${param.myparam2 == "myvalue2"}'>   This is printed if parameter "myparam2" equals "myvalue2" </br>  </c-rt:when>  <c-rt:otherwise>   This is printed if parameter "myparam2" DOES NOT equal "myvalue2" </br>  </c-rt:otherwise> </c-rt:choose> <%-- multiple conditions --%> <c-rt:choose>  <c-rt:when test='${param.myparam3 == "0"}'>   This is printed if parameter "myparam1" equals 0 </br>  </c-rt:when>  <c-rt:when test='${param.myparam3 == "1"}'>   This is printed if parameter "myparam1" equals 1 </br>  </c-rt:when>  <c-rt:otherwise>   This is printed for any other value of the parameter </br>  </c-rt:otherwise> </c-rt:choose></body>

希望本文所述對(duì)大家的JSP程序設(shè)計(jì)有所幫助。

發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 丰原市| 贵南县| 铁力市| 奉节县| 白沙| 改则县| 洪湖市| 西丰县| 略阳县| 长春市| 屯留县| 德化县| 偃师市| 武穴市| 华坪县| 基隆市| 河间市| 兰坪| 札达县| 长丰县| 佛山市| 嵊州市| 满城县| 即墨市| 文化| 咸宁市| 万盛区| 延庆县| 安徽省| 兰西县| 宁阳县| 星子县| 和林格尔县| 怀化市| 无锡市| 红原县| 巴彦淖尔市| 高要市| 武冈市| 诸城市| 广水市|