Tuesday May 10, 2011

Implementing signout for ADF web application

If you are not using UIShell template then you will have to implement the signout mechanism on your own which will take care of terminating the current ApplSession etc. Here is the code snippet you can refer to -

Object reqobj = facesContext.getExternalContext().getRequest();

Object resobj = facesContext.getExternalContext().getResponse();

if (reqobj instanceof HttpServletRequest && resobj instanceof HttpServletResponse)

{

//Casting it to HttpRequest/response object types

HttpServletRequest httpreqobj = (HttpServletRequest)reqobj; HttpServletResponse httpresobj = (HttpServletResponse)resobj;

//The below code calls ApplSessionView.logoutApplSession

ApplSessionView.logoutApplSession(httpreqobj, httpresobj); }

else ApplSessionUtil.terminateSession();

Internally, the call to logoutApplSession() does some extra cookie processing , session attribute removal and eventually calls terminateSession(). terminateSession() - This does the actual job of session detachment and finally the session destruction.

About

Talk on ADF (Mail To: vijay.x.mohan@oracle.com)

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today