@PreserveOnRefresh - Purpose and need?

后端 未结 2 1781
闹比i
闹比i 2021-01-01 02:41

I have a doubt regarding the purpose of @PreserveOnRefresh annotation. What is the purpose of this particular annotation and what are the scenarios in which it has to be use

2条回答
  •  萌比男神i
    2021-01-01 03:05

    When the enduser does press F5 (or click Refresh) in the web browser, then the behaviours is:

    With @PreserveOnRefresh -> Use the same session, just refresh the UI from the server state

    Without @PreserveOnRefresh -> Vaadin is creating a new session for the user and the user is shown the "first" page of your application

    So usually the @PreserveOnRefresh is the intended behaviour, otherwise the user is logged out when he clicks on refresh

提交回复
热议问题