JSTL当中请给出一个c:choose和c:when:标签的例子
3)c:choose,c:when:标签
完成类似java的case的功能:
例 2.2.3
<%@ page contentType="text/html; charset=GBK"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="salary" value="1300" />
<html>
<body>
<c:choose>
<c:when test="${salary <=1800}">
低薪
</c:when>
<c:when test="${salary<=3000&&salary>1800}">
中等
</c:when>
<c:otherwise>
高薪
</c:otherwise>
</c:choose>
</body>
</html>
更多内容请见原文,原文转载自: https://blog.csdn.net/qq_44594371/article/details/103183817