Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to get HttpSession in Weddynpro NW 7.0?

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();

replied

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

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question