gpt4 book ai didi

java - 如何使用strut标签比较0和1

转载 作者:行者123 更新时间:2023-12-01 13:52:41 24 4
gpt4 key购买 nike

我从数据库中获取值 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>

最佳答案

如果 profilePrivacy 是数字,请尝试以下操作:

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

如果 profilePrivacy 是字符串,请尝试以下操作:

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

关于java - 如何使用strut标签比较0和1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19851748/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com