java – 将字符串与JSTL进行比较

前端之家收集整理的这篇文章主要介绍了java – 将字符串与JSTL进行比较前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有两个字符串,我需要比较,但即使他们有相同的值或不同,它总是输入语句…
<c:when test="#{bean.name1 != bean.name2}">
     fields that are supposed to appear _only_ when name1 is different from name2
</c:when>

解决方法

问题是你可能没有在选择标签中包装.

如果你有:

<c:choose>
    <c:when test="${bean.name1 != bean.name2}">
        fields that are supposed to appear _only_ when name1 is different from name2
    </c:when>
</c:choose>

它会奏效

猜你在找的Java相关文章