<c:choose>
<c:when test = "${pageScope.staffsBean.staffsState == 在职}">
.....//执行代码
</c:when>
<c:otherwise>
.....//执行代码
</c:otherwise>
</c:choose> 在这段代码中pageScope.staffsBean.stateState(String类型)的值明明是在职可老是执行otherwise,是我的EL表达式判断有问题吗?在职两个字用""引起来吗~?
<c:when test = "${pageScope.staffsBean.staffsState == 在职}">
.....//执行代码
</c:when>
<c:otherwise>
.....//执行代码
</c:otherwise>
</c:choose> 在这段代码中pageScope.staffsBean.stateState(String类型)的值明明是在职可老是执行otherwise,是我的EL表达式判断有问题吗?在职两个字用""引起来吗~?
<c:when test = "${pageScope.staffsBean.staffsState eq '在职 '} ">
字符串对比要用eq,后面要加单引号