1.首先需要导入使用的标签
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
2.使用判断标签 "choose"
<c:choose>
<c:when test="1 == 1">
<h1>这是h1标签</h1>
</c:when>
<c:otherwise>
<h2>这是h2标签</h2>
</c:otherwise>
</c:choose>
when标签则是相当于 if, otherwise 标签相当于 else, when中的test则是条件, 结果为true时,则显示h1标签的内容,否则显示h2标签的内容。
内容如有错误,请指正! 联系 wx 15514769010。
