gpt4 book ai didi

java - 在 JSP 中检查请求属性

转载 作者:搜寻专家 更新时间:2023-11-01 02:15:07 24 4
gpt4 key购买 nike

我正在尝试检查 jsp 中的请求属性以显示/隐藏某些 html。

request.setAttribute("submitted", "true");

jsp:

<c:if test="${submitted == 'false'}">
// some html
</c:if>

但是无论我在属性中设置什么值,条件总是计算为 false。属性在条件中不可见吗?

萨希尔

最佳答案

试试这个:

request.setAttribute("submitted", true);

在你的 JSP 中:

<c:if test="${submitted}">
// some html
</c:if>

关于java - 在 JSP 中检查请求属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7626406/

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