jsf - What are jftfdi jffi doing to my query string? -


we using javaserver faces 2.2 (mojarra 2.2.1) in our project. noticed odd. on page called reporting.xhtml use f:metadata new f:viewaction browser, safari in case, shows following query string:

reporting.jsf?jftfdi=&jffi=reporting%3ffaces-redirect%3dtrue 

what wizardry this? parameters jftfdi , jiffi doing? purpose?

it's part of new jsf 2.2 feature described spec issue 949. basically, enables jsf identify client window. it's same cid in cdi's @conversationscoped , windowid in codi's @viewscoped/@viewaccessscoped. client window id in turn used among others new jsf 2.2 @flowscoped scope described spec issue 730.

the "what's new in jsf 2.2?" article of fellow arjan tijms explains need pretty clearly:

lifecycle

identify client windows via window id

arguably 1 of biggest problems has been plaguing web application development since inception inability distinguish requests originating different windows of single browser. not has actual solution been long overdue, has taken long time realize problem.

the root of problem, always, http protocol inherently stateless while applications in general not. there concept of cookie though, overwhelmingly mechanism used distinguish requests different users , implement things session scope on turn bulk of login mechanisms based on.

while cookie work this, it’s global per browser , domain. if user opens multiple tabs or windows same domain requests send same cookie server. logging in different user in different window same website not possible, , having workflows (involving post-backs, navigation) in different windows can troublesome because of this.

in jsf there various solutions somehow related this. view scope implements session per window long user stays on same page , post-backs. flash used transferring data between different pages (presumably within same window) when navigation done via redirect/get. there’s wide variety of scopes implemented third parties similar.

all of these have implicit notion or assumption of concept of ‘client window’, there no explicit api this.

jsf 2.2 introduce support 2 different aspects of this:

  • identification of individual window: client window id
  • api , life-cyle awareness of window concept

apparently you've configured application such.

see also:


Comments