Are JSF views shared between users?

I have defined # boolean views and views in session attributes in web.xml file to be 1, so there is only a maximum of 1 view. With this in mind, I have several questions:

  • Is this # specific to a given user? So this limits the number of views to 1 per user? ** If yes, can there be multiple views of the same JSP view for multiple users?

  • Is there a way to share the JSF view between users (given that the view is rather generic and doesn't contain any specific data)?

Thank!

+1


source to share


1 answer


If your general definition of "user" is effectively "HTTP session", then yes, you are correct. Views are mostly stored in the HTTP session and referenced a hidden HTML input field named javax.faces.ViewState

. Different HTTP sessions won't share their views with each other, which would clearly be a huge mistake and a security hole otherwise.



By setting the number of (boolean) views in a session to, 1

you remove the possibility that a user can use multiple views containing POST forms in different windows / tabs in the same session. Every time enduser opens a new window / tab, enduser will receive ViewExpiredException

whenever enduser fires a POST request on the previous window / tab, because you've configured it to only keep one view in the session, which is the last one open.

+3


source







All Articles