cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro cookie read: Servlet workaround, but session problems...

Former Member
0 Kudos

Hi experts,

As the subject of this message indicates, I need to access cookies from WebDynpro. As of NW2004S this is no longer possible using the feature (/hack?):

HttpServletRequest request = TaskBinder.getCurrentTask().getWebContextAdapter().getHttpServletRequest();

Nor does the WDProtocolAdapter class as suggested by some threads give me access to the servlet request.

Discouraged by this fact and I have now created a servlet which reads the particular cookie and passes a specific value along to my troublesome Web Dynpro application, displaying it in an iFrame, in effect solving my problem.

However, my session handling seems to be wrong because refreshing the iView creates a new session (or window? - based on the sap-wd-cltwndid parameter?) resulting in JCO connections to hang in the backend (ERP 2005).

Does anyone have an idea of what might be wrong with my session handling?

I've done this kind of pass-through before but only between Web Dynpro applications where the WDWebContextAdapter can be used to look up Web Dynpro parameters. Coming from a JSPDynPage, this is not possible, I believe?

Any suggestions will be greately appreciated!

Kind regards,

Rasmus Ørtoft

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi everyone,

This problem has been haunting me for quite some time and I have finally solved it!

Instead of creating a wrapper for the Web Dynpro that can read the cookie, I simply use the SAP Application Integrator, most excellently described her:

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b0446f5c-fcb9-2910-e082-88becbe3ddc9">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b0446f5c-fcb9-2910-e082-88becbe3ddc9</a>

Using the Application Integrator I defined a service for reading the session cookie (i.e. the servlet request - HTTPServletRequest) and accessing the information that I need from the session. This information is then forwarded as parameters for the Web Dynpro applications. And this actually works once you get your head around the service needed for the parameter extraction.

Kind regards,

Rasmus

Former Member
0 Kudos

Hi Rasmus,

"Using the Application Integrator I defined a service for reading the session cookie (i.e. the servlet request - HTTPServletRequest) and accessing the information that I need from the session. This information is then forwarded as parameters for the Web Dynpro applications. And this actually works once you get your head around the service needed for the parameter extraction."

I am alos facing the same problem. I followed the document..what you provided.

But I could understand much. Could you please provide some detailed information ..if possible with code...for doing this.

Thanks a lot

Sreekanth