Topic
  • 2 replies
  • Latest Post - ‏2010-10-11T09:54:15Z by SystemAdmin
SystemAdmin
SystemAdmin
2583 Posts

Pinned topic How to get HttPSession object in WCS ?

‏2007-12-14T04:00:59Z |
I came across a thread where HttpSession object can be obtained through HttpRequest object in the following way:

*******************************************
HttpControllerRequestObject request = (HttpControllerRequestObject) getCommandContext().getRequest();
HttpServletRequest m_request = request.getHttpRequest();
HttpSession session = m_request.getSession();
session.setAttribute("userType","x");
*******************************************

The 'getCommandContext().getRequest()' method is deprecated in WCS 6.0. Can anyone explain as to what the alternative is to get the HttpRequest object using any other means other than calling getRequest() on getCommandContext()?

The aim here is to get the HttpSession object. Is there any other way to get HttpSession in WCS 6.0

Please explain.

Thanks a lot for the info.
Updated on 2010-10-11T09:54:15Z at 2010-10-11T09:54:15Z by SystemAdmin
  • DavidNixon
    DavidNixon
    21 Posts

    Re: How to get HttPSession object in WCS ?

    ‏2008-01-04T19:41:21Z  
    Is this a Portal or Workplace question? Workplace is still on version 2.6 not 6.0.
  • SystemAdmin
    SystemAdmin
    2583 Posts

    Re: How to get HttPSession object in WCS ?

    ‏2010-10-11T09:54:15Z  
    Is this a Portal or Workplace question? Workplace is still on version 2.6 not 6.0.
    I too have the same problem. I am using IBM Websphere Commerce server 6.0.

    I need to get the customer IP Address from the HTTP request object. I am unable to get the request object by calling getCommandContext().getRequest(). My command is called by scheduler.

    Please help..

    Thanks,
    Dileep