on 09-09-2008 4:14 PM
Do you know how to do the same code below in NW 7.0?
NW 04 way:
HttpServletRequest request =((IWebContextAdapter)WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();
HttpSession session = request.getSession();
Hi,
You can also achieve the session Sotrage, this way from web dynpro.
//Setting value in session
IMaintainScope maintainer = Utils.getScopeMaintainer(WDScopeType.CLIENTSESSION_SCOPE);
maintainer.getScope().put("Session_Key", value);
//Getting value from session
IMaintainScope maintainer = Utils.getScopeMaintainer(WDScopeType.CLIENTSESSION_SCOPE);
if(maintainer.getScope().get("Session_Key") != null){
value = maintainer.getScope().get("Session_Key).toString();
}
I Hope it helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi shabir rahim ,
do you know if this way of storing a value in a session is supported in NW 7.0?
or if they plan to deprecate it later on? i dont want to build a solution based off it and have them take the API away later....this has happened too many times....
Edited by: K Ferguson on Sep 11, 2008 10:48 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i need to get the unique session id for a custom usage tracking application...is there any way to get a unique id that identifies the users browser session?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am utimately only trying to get the unique browser sessionId...
String sessionId = session.getId();
HttpServletRequest request = ((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();
HttpSession session = request.getSession();
String sessionId = session.getId();
Edited by: K Ferguson on Sep 9, 2008 5:32 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I'm afraid that you can't access HttpServletSession object in WebDynpro via public API. See [this thread|https://www.sdn.sap.com/irj/sdn/thread?messageID=1329730#1329730].
What is that you need to access Session for? You can get the request object with code given below though.
IWDProtocolAdapter prt = WDProtocolAdapter.getProtocolAdapter();
IWDRequest req = prt.getRequestObject();
Vishwas.
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.