Java 如何使用支柱标记比较0和1

Java 如何使用支柱标记比较0和1,java,struts,Java,Struts,我从数据库中得到值0和1,我想在我的jsp页面中比较该值, 我尝试了下面的代码,但比较不正确 <c:choose> <c:when test="%{#groupProfileView.userinfo. profilePrivacy}== 1"> creator name: ${groupProfileView.userinfo.firstName} </c:when> <

我从数据库中得到值0和1,我想在我的jsp页面中比较该值, 我尝试了下面的代码,但比较不正确

<c:choose>
            <c:when test="%{#groupProfileView.userinfo. profilePrivacy}== 1">
          creator name: ${groupProfileView.userinfo.firstName}
          </c:when>
          <c:otherwise>anonmous</c:otherwise>
          </c:choose>

创建者名称:${groupProfileView.userinfo.firstName}
异常的
将其更改为

<c:when test='${groupProfileView.userinfo.profilePrivacy eq "1"'>


相关的


如果
个人资料隐私
是一个数字,请尝试下一个:

<c:when test="${groupProfileView.userinfo.profilePrivacy == 1}">
<c:when test="${groupProfileView.userinfo.profilePrivacy == '1'}">

但它仍然不起作用。它总是采用其他条件。我像这样尝试使用并检查返回的值。OGNL和JSTL的混合似乎不是一个好主意。不要忘记,如果答案令人满意地解决了您的问题,您可以。