简体   繁体   中英

How can I force to create a new session every time I open a new browser tab with Oracle ADF and JAVA?

I'm developing a web application with oracle-ADF. I have a page with information of client, when i open a new page with an id of another client, and I reload the page, I will have he same information. The session is shared between the pages. The browser is IE.

How can I force to create a new session every time I open a new browser tab?

You have to specify a smaller scope to the taskflow of your page as it is set to session scope by default. (Data persist in the session variable of your browser) (cf. https://docs.oracle.com/cd/E15051_01/web.1111/b31974/adf_lifecycle.htm#ADFFD524 figure 21.3)

By default, the binding container and the binding objects it contains are defined in session scope. However, the values referenced by value bindings and iterator bindings are undefined between requests and for scalability reasons do not remain in session scope. Therefore, the values that binding objects refer to are valid only during a request in which that binding container has been prepared by the ADF lifecycle. What stays in session scope are only the binding container and binding objects themselves.

Use as follow :

  • ApplicationScope : widest Scope. data will be available even when you close and open the application again
  • SessionScope : Data will be available as a cookie in your web browser
  • PageFlowScope : Data will be available in the current tab. (you'll have different data if you open another window tab) The data will be available from one page to another
  • viewScope : Data will be available only on the current display tab and will not persist when you navigate. (this may be what you are looking for)
  • backingBeanScope : Data will be different for each element of your page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM