jstl功能
使用if语句,如果满足某种条件,则显示相关html节点
<!-- https://mvnrepository.com/artifact/javax.servlet/jstl --> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency>
在相关界面html标签前面开头 加上
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
相关代码
<c:if test="${message != null} "> <div class="alert alert-danger alert-dismissible"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> ${message} </div> </c:if>