gpt4 book ai didi

jsp - not working for comparing characters

转载 作者:行者123 更新时间:2023-12-04 10:24:49 27 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





How to compare a char property in EL

(1 个回答)


4年前关闭。



<c:if>不适用于比较字符。代码在表格内。这是代码

<c:if test="${record.type eq 'U' }">Planned</c:if>

当我在表格内使用此代码时,表格内容不显示。请帮助!

最佳答案

问题是 EL 支持双引号和单引号字符串。所以'U'被视为 String ,不是 char .要解决此问题,您可以使用 charAt(0)该字符串上的方法:

<c:if test="${record.type eq 'U'.charAt(0) }">Planned</c:if>

关于jsp - <c :if> not working for comparing characters,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25498223/

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