如何使用el表达式判断多个值是否相等?

第一种:

<c:if test="${v==1 && u==2}">

</c:if>

第二种:

<c:if test="${v eq 1 and u eq 2}">

</c:if>

对EL表达式中取到的值进行判断后显示:

<c:if test="${list.status eq 1}">正确<c:if>
<c:if test="${list.status eq 2}">错误<c:if>
然后记得在页面头部导入C标签
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

猜你喜欢

转载自blog.csdn.net/qq_37811638/article/details/80010601