1

As far as I understand, in JSF 1.1 all GET requests resulted in a postback to the current view when it such a view existed. In JSF 1.2, this changed so that GET always created a new view, so that bookmarking worked. Is it still possible to stay in the current view using GET requests, that is, to have the behavior as it was in 1.1?

Example

  • GET welcome page, rendered from facelets welcome.xhtml file, containing <h:commandLink action="inventory">
  • click on the link for POST request of inventory.xhtml. Inventory shows, browser URL is still welcome
  • do page reload in browser. In JSF 1.1, inventory is redisplayed. In JSF 2.0, welcome page is displayed
  • I can add ?faces-redirect=true to the action to get a different URL for the inventory page, so that page reload redisplays the inventory
  • how can I get the behavior of JSF 1.1, that is, redisplay the inventory on GET welcome without doing a redirect?

Why I would like to do that: Don't expose internals of the webapp to browser URL, keep entire webapp under one URL, save request roundtrips, have smooth incremental page updates instead of complete page changes in browser

4

1 に答える 1

0

最後に、アプリケーション ビューのローカル状態によって選択された、目的のアプリケーション ページを動的に含む単一のアプリケーション ビューを用意することで、要件を解決しました。

于 2013-08-16T12:37:54.627 に答える