隐藏 URL 中的视图参数

发布于 2024-12-22 17:27:41 字数 247 浏览 0 评论 0原文

我们正在使用 JSF 2.0。我们必须将视图参数从一个页面传递到另一个页面,因为页面是视图范围的。我们正在获取参数中的值,但我想知道是否有办法隐藏 URL 中的参数?

`public String submitForm(){`
 `return "submitPage+faces-redirect=true&includeViewParameters=true&value=" + myBean.id;`
 }

We are using JSF 2.0. We have to pass in view parameters from one page to another page as the pages are view scoped. We are getting the values in the params but I would like to know if there is there a way to hide the parameters in the URL?

`public String submitForm(){`
 `return "submitPage+faces-redirect=true&includeViewParameters=true&value=" + myBean.id;`
 }

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

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

发布评论

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

评论(1

飞烟轻若梦 2024-12-29 17:27:42

隐藏 URL 中的参数

所以您想使用 POST 而不重定向?然后相应地执行此操作:

public String submitForm() {
    return "submitPage";
}

在目标页面中,#{myBean.id} 将按通常方式在 EL 中可用。

to hide the parameters in the URL

So you want to use POST without redirect? Then just do that accordingly:

public String submitForm() {
    return "submitPage";
}

In the target page, the #{myBean.id} will just be available in EL the usual way.

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