How to access any HTTP session data in Oracle ADF

How to access any HTTP session data in Oracle ADF

If you have ever wondered how to get access to any HTTP session in your ADF application this post will solve the problem.

The first step is to prepare your HttpSessionListener implementation in a View Controller project.


After that register it in web.xml  file (1,2,3,4,5)

You can edit web.xml file directly:


Sessions are stored in HTTP_SESSIONS collection. The listener provides two additional static methods which allows you to access to the session data:

  • getHttpSessions – returns valid (current) sessions collection.
  • findHttpSession – returns session object or null if sessionId does’t exists.


The result

Turn on debug by uncommenting System.out lines in the listener. After login you should see something like below



Now you are able to handle any creation and destruction of http session in your application by calling:


The peace of code below prints all active session’s id;

Leave a Reply

Notify of
Close Menu