最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

 更新時間:2015年10月10日 11:33:16   作者:紅薯  
這篇文章主要介紹了JSP中使用JSTL按不同條件輸出內(nèi)容的方法,實例分析了JSP標簽庫JSTL的相關(guān)使用技巧,具有一定參考借鑒價值,需要的朋友可以參考下

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

ConditionalContentJSTL.jsp頁面:

<%@ 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>

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

相關(guān)文章

最新評論

文水县| 甘德县| 周至县| 额敏县| 呼图壁县| 隆子县| 瓮安县| 永和县| 陇西县| 玉溪市| 正安县| 太康县| 当涂县| 云南省| 丽水市| 买车| 资阳市| 海宁市| 思南县| 峨边| 黑河市| 阜南县| 保靖县| 十堰市| 台湾省| 深水埗区| 洪江市| 白沙| 灵山县| 石城县| 西充县| 康定县| 许昌县| 广西| 林州市| 沽源县| 浦县| 邵东县| 改则县| 滕州市| 柞水县|