JSP JSTL < C: otherwise > tag: Specifies the default processing logic tag
•
Java
< C: otherwise > label body < / C: otherwise >
Example
<%@page import="java.util.*"%> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%random rnd = new Random();%> <c:set var="luck"> <%=rnd.nextInt(10)%> </c:set> <c:choose> <c:when test="${luck==6}">恭喜你,中了一等奖!</c:when> <c:when test="${day==7}">恭喜你,中了二等奖!</c:when> <c:otherwise>谢谢您的参与!</c:otherwise> </c:choose>
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码