如果 URL 中存在参数,如何渲染组件

发布于 2024-12-13 03:50:55 字数 219 浏览 1 评论 0原文

我有一个包含一些文本的 div 如果 url 中存在参数,我想显示它,

就像 JSTL 中那样,

<c:if ${param.loginError!=null}>

<div>

Wrong username/password

</div>

</c:if>

如何在 JSF 中做到这一点?

i have a div that contains some text
and i want to display it if a parameter is presented in the url

as in JSTL

<c:if ${param.loginError!=null}>

<div>

Wrong username/password

</div>

</c:if>

how to do that in JSF ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沙沙粒小 2024-12-20 03:50:55

使用rendered 属性。

<h:panelGroup layout="block" rendered="#{param.loginError != null}">
    Wrong username/password.
</h:panelGroup>

另请参阅:

Use the rendered attribute.

<h:panelGroup layout="block" rendered="#{param.loginError != null}">
    Wrong username/password.
</h:panelGroup>

See also:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文