cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve HTTP Session attribute value

0 Kudos

Hi,

Using Web Dynpro for Java, how can I retrieve from Http Session one attribute setup by a standard Java app?

The value was setup like this:

IPortalComponentSession compSession = request.getComponentSession();

//where IPortalComponentRequest request

javax.servlet.http.HttpSession thisHttpSession = null;

thisHttpSession = compSession.getHttpSession();

thisHttpSession.setAttribute("myvalue","test");

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Were u able to retrieve the value as I have a similar requirement and I am unable to get the parameter value using protocoladapter.

Thanks

Answers (3)

Answers (3)

0 Kudos

Seems that there is no bridge between Web Dynpro iView and Standard Portal iViews, ways of retrieving Session variables from one to another.

Therefore to solved my issue creating Web Dynpro iView that save the needed value using:

WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE,…)

and I can retrieved them from other Web Dynpro applications using the: WDScopeUtil.get(WDScopeType.CLIENTSESSION_SCOPE,..)

Thank you all for your help.

Former Member
0 Kudos

Thanks, Corina. That will help us a lot. An earlier post by Bertram seemed to suggest to use storing in a database.

Thanks

Raj Balakrishnan

0 Kudos

No, this doesn’t work.

Where can I store then global name/values that need to be used by other Web Dynpro iView and Standard Portal iViews?

Thank you

Former Member
0 Kudos

Corina,

The WD framework has been designed to store the session data in the Component controller. Map your views data to the Component controller and access the component controller's data in the second view by making similar mapping. For more details refer to the following tutorial.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de18b94a...

Thanks!

Surya.

Former Member
0 Kudos

Hi,

Make use of the WDScopeUtils.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

You can retrieve the value as being told by Chintan and store in the context of your component controller if the same needs to be shared amongst different views.

Regards,

Murtuza

chintan_virani
Active Contributor
0 Kudos

Corina,

I am not sure if you can get HTTP session attributes but you may give this a try:


IWDProtocolAdapter protocolAdapter = WDProtocolAdapter.getProtocolAdapter();
IWDRequest request = protocolAdapter.getRequestObject();
String paramValue = request.getParameter("<atributename>");

Chintan