【问题标题】:<C:IF> Check wether the two paramters are the same or not<C:IF> 检查两个参数是否相同
【发布时间】:2016-03-10 13:04:10
【问题描述】:

只有当数据库中的文本是我给页面的参数时,我才有这个 if 语句二显示图片:

<c:if test="${row.hozzaadta}==${param.userid}">
       <img src="http://cdn3.iconfinder.com/data/icons/softwaredemo/PNG/128x128/DeleteRed.png" width="25" height="25">
    </c:if>

它不工作,我很确定我用错了,你能帮帮我吗?

【问题讨论】:

    标签: jsp if-statement netbeans derby


    【解决方案1】:

    我认为这是不可能的,但我会像这样从servlet 发送布尔值

    boolean myBool = row.getHozzaadta().equals(param.getUserId());
    request.setAttribute("myBool", myBool);
    

    而在JSP

    <c:if test="${ myBool }"></if>
    

    【讨论】:

      猜你喜欢
      • 2023-04-07
      • 2019-11-25
      • 2021-06-21
      • 2014-08-23
      • 1970-01-01
      • 1970-01-01
      • 2016-01-24
      • 2017-11-02
      相关资源
      最近更新 更多