Skip to Content
avatar image
Former Member

Storing and recovering data from HTTP Sessions in Web Dynpro

Hello,

In our system we are using a HTTP Filter to recover data in our Web Project, which is a Web Dynpro 7.2 DC. The data is a cookie, and its content needs to be used later in WebDynpro context.

We need to acess the HTTP Session in Web Dynpro, or send data to Web Dynpro session from the Filter.

We tried WDScopeUtil.put() method but in filtering time this goes to a NullPointerException (Which we are not surprised since Web Dynpro engine do not start till the filtering is done).

In our research we also tried IWebContextAdapter but this class does not exist in the project library.

Is there a way to access the HTTP Session within Web Dynpro? Any other sugestions will be very appreciated.

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Oct 10, 2011 at 05:20 PM

    Hi,

    Even we had the same senario and tried the following code:

    WDScopeUtil.put(WDScopeType.CLIENTSESSION_SCOPE,"APP_NAME",Currentapp);

    But as such, we used alternate method also..We wrote the values in Cookies and read in the below way:

    IRequest requestObj = ((IProtocolAdapter) WDProtocolAdapter.getProtocolAdapter()).getRequestObjectInternal();
    HttpServletRequest request = (HttpServletRequest)requestObj.getProtocolRequest();
    Cookie[] cookies = request.getCookies();
    

    Regards,

    Vijay.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Below are all the lib I imported..

      com.sap.tc.webdynpro.clientserver.event.api.WDPortalEventing;

      com.sap.tc.webdynpro.clientserver.navigation.api.WDPortalNavigation;

      com.sap.tc.webdynpro.clientserver.navigation.api.WDPortalNavigationHistoryMode;

      com.sap.tc.webdynpro.clientserver.navigation.api.WDPortalNavigationMode;

      com.sap.tc.webdynpro.progmodel.api.IWDAttributeInfo;

      com.sap.tc.webdynpro.progmodel.api.IWDModifiableBinaryType;

      com.sap.tc.webdynpro.progmodel.api.WDVisibility;

      com.sap.tc.webdynpro.services.sal.adapter.api.WDProtocolAdapter;

      com.sap.tc.webdynpro.services.sal.adapter.core.IProtocolAdapter;

      com.sap.tc.webdynpro.services.sal.adapter.core.IRequest;

      com.sap.tc.webdynpro.services.sal.localization.api.WDResourceHandler;

      com.sap.tc.webdynpro.services.session.api.WDScopeType;

      com.sap.tc.webdynpro.services.session.api.WDScopeUtil;

      Regards,

      Vijay.

  • avatar image
    Former Member
    Oct 18, 2011 at 08:13 PM

    Problem was solved with the following code, without importing any aditional library:

    HttpServletRequest param = (HttpServletRequest)WDProtocolAdapter.getProtocolAdapter().getRequestObject().getProtocolRequest();

    HttpSession session = param.getSession();

    Add comment
    10|10000 characters needed characters exceeded