gpt4 book ai didi

jsf - jftfdi jffi 对我的查询字符串做了什么?

转载 作者:行者123 更新时间:2023-12-04 11:26:09 25 4
gpt4 key购买 nike

我们在项目中使用 JavaServer Faces 2.2 (Mojarra 2.2.1)。我注意到一些奇怪的事情。在一个名为 reporting.xhtml 的页面上我在哪里使用 f:metadata与新 f:viewAction在本例中,我的浏览器 Safari 显示以下查询字符串:

reporting.jsf?jftfdi=&jffi=reporting%3Ffaces-redirect%3Dtrue

这是什么法宝? jftfdi 和 jiffi 的参数是什么?他们的目的是什么?

最佳答案

它是规范 issue 949 中描述的新 JSF 2.2 特性的一部分.基本上,它使 JSF 能够识别客户端窗口。和cid基本一样在 CDI 的 @ConversationScopedwindowId在 CODI 的 @ViewScoped/@ViewAccessScoped .这个客户端窗口 ID 反过来被新的 JSF 2.2 @FlowScoped 使用。规范描述的范围 issue 730 .
“JSF 2.2 中的新功能是什么?”我的同事 Arjan Tijms 的文章非常清楚地解释了这种需求:

LifeCycle

Identify client windows via a Window Id

Arguably one of the biggest problems that has been plaguing web application development since its inception is the inability to distinguish requests originating from different windows of a single browser. Not only has an actual solution been long overdue, it has taken a long time to realize this even was a problem.

The root of the problem, as always, is that the HTTP protocol is inherently stateless while applications in general are not. There is the concept of a cookie though, which is overwhelmingly the mechanism used to distinguish requests from different users and to implement things like a session scope where on its turn the bulk of login mechanisms are based on.

While a cookie does work for this, it’s global per browser and domain. If a user opens multiple tabs or windows for the same domain then requests from those will all send the same cookie to the server. Logging in as a different user in a different window for the same website is thus not normally possible, and having workflows (involving post-backs, navigation) in different windows can also be troublesome because of this.

In JSF there are various solutions that are somehow related to this. The view scope effectively implements a session per window as long as the user stays on the same page and does only post-backs. The Flash is used for transferring data between different pages (presumably within the same window) when navigation is done via Redirect/GET. There’s a wide variety of scopes implemented by third parties that do something similar.

All of these have some implicit notion or assumption of the concept of a ‘client window’, but there is no explicit API for this.

JSF 2.2 will introduce support for two different aspects of this:

  • Identification of an individual window: the Client Window Id
  • API and life-cyle awareness of the window concept

显然您已经这样配置了您的应用程序。
也可以看看:
  • What's new in JSF 2.2? - Lifecycle - Identify client windows via window Id
  • What's new in JSF 2.2? - Navigation - Faces Flow
  • 关于jsf - jftfdi jffi 对我的查询字符串做了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17594856/

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