choose.jsp
来自「jakarta-taglibs」· JSP 代码 · 共 28 行
JSP
28 行
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>JSTL: Conditional Support -- Mutually Exclusive Conditional Execution Example</title>
</head>
<body bgcolor="#FFFFFF">
<h3>Mutually Exclusive Conditional Execution</h3>
<h4>USA:blue Canada:red Others:green</h4>
<c:forEach var="customer" items="${customers}">
<c:choose>
<c:when test="${customer.address.country == 'USA'}">
<font color="blue">
</c:when>
<c:when test="${customer.address.country == 'Canada'}">
<font color="red">
</c:when>
<c:otherwise>
<font color="green">
</c:otherwise>
</c:choose>
${customer}</font><br>
</c:forEach>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?