on 12-03-2009 12:02 PM
Hi Experts,
We are trying to set some value in session using Webdynpro, but its getting cleared after sometime. We are setting the Value in one WD application and using it in all other WD application.
The method used to put and get is given below.
Is there any other method which can be used so that the session value stays.
Setting the Value using:
WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE, "APP_NAME", appvalue1);
Getting the Value from session:
WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE, "BP_ID");
Thanks
Hi
The CLIENTSESSION_SCOPE is the most long living among all other WD scope types. It's life time equals to user session life time. Of course if you close the browser, open it again and login with same user the scope will be empty because it'll be a new user session.
If you need something storage living longer then CLIENTSESSION_SCOPE, then use some storage on a server (DB, for example). Or another option is Cookies that is supported only by the last WebDynpro versions.
BR, Siarhei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mohamed,
Could try the HttpSession method instead of your session method.
This is the set method,
HttpServletRequest request = ((IWebContextAdapter).wDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();
HttpSession session = request.getSession(true);
session.setAttribute("XXX","Test1");
and this one is get method,
String getString = "";
HttpSession session = wdContext.currentSessionElement().getHttpSession();
getString = session.getAttribute("XXX").toString();
Regards,
Prabha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.