JSF: initial request and postback request?

后端 未结 3 2013
忘了有多久
忘了有多久 2021-02-01 06:05

Please take a look at this below line of code in JSF


Quote from java.sun.com:

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-01 06:37

    Normally you would have only one initial request, when you go to the browser and write in the URL to your app. This make an HTTP GET request to the server with your cookies e.g. JSESSIONID, but not with a javax.faces.viewid to be restored.

    When you have an open page and you do hacky stuff lick: window.location = newUrl -> you will also make an initial request.

    When instead you do something like jQuery("#somoeSubmitButton").click(), you will POST to the server and your old view will be restored - and if you ask faces context.isPostback() ? you will get true.

提交回复
热议问题