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

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

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

本文實(shí)例講述了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>

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

相關(guān)文章

最新評(píng)論

克东县| 镇康县| 上饶市| 新龙县| 肇东市| 循化| 祁连县| 望谟县| 凌源市| 读书| 进贤县| 恩平市| 临邑县| 广州市| 罗源县| 临湘市| 鹰潭市| 宝山区| 明光市| 南城县| 海阳市| 陈巴尔虎旗| 东山县| 栖霞市| 富裕县| 绵竹市| 芮城县| 岳阳县| 临洮县| 天长市| 岗巴县| 浙江省| 思茅市| 德州市| 咸阳市| 鞍山市| 商水县| 三河市| 会东县| 石台县| 金昌市|