java----jstl使用
1、在pom中引入依赖
在maven 仓库中可以查看最新版
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。<dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency>
2、在jsp中插入
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
3、使用
利用c:if判断,如果message为空,就不显示;$(message!=null)
利用这种思路
如果简单可以使用这种方式来替代jstl
<div class="callout callout-danger" ${message==null?"style='display: none'":""}> <h4>${message}</h4> </div>
或者
<div class="callout callout-danger" style="display: ${message==null?"none":""};" }> <h4>${message}</h4> </div>

更多精彩