Difference between JSF view instances: new view, initial view, and postback view

守給你的承諾、 提交于 2019-12-24 01:06:16

问题


I did some research on JSF view instances: new view, initial view, and postback view. But, I am still not quite sure about the differences. It's kind of confusing and I haven't been able to find a good explanation on that. Can somebody put some light on this one?


回答1:


That was how JSF 1.0/1.1 works. They are explained in detail in this ancient IBM article. But you should forget and ignore the whole article (see also "Editor's notes" section on top which was edited in afterwards). It does not apply anymore since JSF 1.2 and newer (including JSF 2.x). There is only "initial view" and "postback view". The "new view" does not exist anymore.

An initial view is been created upon a GET request and an existing view is been reused upon a POST request. When a GET request results in a response with a <h:form> for POST, then the (partial) view is referenced by a hidden input field with name javax.faces.ViewState. This very same same view will be restored and used to process the form submit (the postback).



来源:https://stackoverflow.com/questions/5912534/difference-between-jsf-view-instances-new-view-initial-view-and-postback-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!