Forum Stats

  • 3,839,382 Users
  • 2,262,486 Discussions
  • 7,900,955 Comments

Discussions

Store URL parameter for session only

Varun Dhondea
Varun Dhondea Member Posts: 163 Blue Ribbon
edited Apr 17, 2018 4:42PM in JDeveloper and ADF

Hi,

I have 2 URL parameters jwt and lang. I have retrieved the parameter using    

jwt=<something>&lang=fr

    public void prepareSession()      {         HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();         String lang = request.getParameter("lang");         String jwt_token = request.getParameter("jwt");         FacesContext.getCurrentInstance().getExternalContext().getApplicationMap().put("jwt_token",jwt_token);         FacesContext.getCurrentInstance().getExternalContext().getApplicationMap().put("lang",lang);     }

This code is called in

public XXCO000_STG_HISTO_AMImpl() {prepareSession();}

My issue is that whenever there are two different users connected, the last user is overriding the values i.e. if language of user1 is US and language of user2 is FR. User 1 gets language FR when user2 is connected.

How to use these values in session?

Jdeveloper version 12.2.1.1

Regards

Best Answer

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,591 Red Diamond
    edited Apr 9, 2018 4:06AM Answer ✓

    You store the data in the application map, meaning application scope. This map is shared by all users, so yes, user 2 overwrite the data of user 1.

    Save the parameters in session scope (getSessionMap()) instead and it should work.

    Timo

Answers

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,591 Red Diamond
    edited Apr 9, 2018 4:06AM Answer ✓

    You store the data in the application map, meaning application scope. This map is shared by all users, so yes, user 2 overwrite the data of user 1.

    Save the parameters in session scope (getSessionMap()) instead and it should work.

    Timo

This discussion has been closed.