You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Deepa Priolkar <de...@TechMahindra.com> on 2010/11/17 12:20:12 UTC

Session in Services

Hi All,

 

We are facing some issue related to the HTTP Session.

How can we access the HTTP Session in the Ofbiz Services.

 

Please let me know...

Thanks & Regards,

Deepa


============================================================================================================================Disclaimer:  This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at <a href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahindra.com/Disclaimer.html</a> externally and <a href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahindra.com/Disclaimer.html</a> internally within Tech Mahindra.============================================================================================================================

Re: Session in Services

Posted by Adrian Crum <ad...@hlmksw.com>.
I agree with Rishi - the Session object should not be accessed in 
services. Services should not "know" about the Session object. The 
session attributes are copied to the service context, so there should be 
no need to access the Session object directly.

-Adrian

On 11/17/2010 6:39 AM, Rishi Solanki wrote:
> Hi Deepa,
>
> You can add the request and response objects as in parameters to service to
> get them inside the service.
> <attribute name="request" mode="IN"
> type="javax.servlet.http.HttpServletRequest"/>
> <attribute name="response" mode="IN"
> type="javax.servlet.http.HttpServletResponse"/>
>
> get the request object from the context in side the service and from request
> object get the session.
> But it is not good to directly define the request and response object as in
> parameter for the service. You will be always able to get all the parameters
> from request/session by defining them as in parameter for the service.
>
> --
> Rishi Solanki
> Manager, Enterprise Software Development
> HotWax Media Pvt. Ltd.
> Direct: +91-9893287847
> http://www.hotwaxmedia.com
>
>
> On Wed, Nov 17, 2010 at 4:50 PM, Deepa Priolkar<de...@techmahindra.com>wrote:
>
>> Hi All,
>>
>>
>>
>> We are facing some issue related to the HTTP Session.
>>
>> How can we access the HTTP Session in the Ofbiz Services.
>>
>>
>>
>> Please let me know...
>>
>> Thanks&  Regards,
>>
>> Deepa
>>
>>
>> ============================================================================================================================Disclaimer:
>>   This message and the information contained herein is proprietary and
>> confidential and subject to the Tech Mahindra policy statement, you may
>> review the policy at<a href="http://www.techmahindra.com/Disclaimer.html
>> ">http://www.techmahindra.com/Disclaimer.html</a>  externally and<a href="
>> http://tim.techmahindra.com/Disclaimer.html">
>> http://tim.techmahindra.com/Disclaimer.html</a>  internally within Tech
>> Mahindra.============================================================================================================================
>>
>

Re: Session in Services

Posted by Rishi Solanki <ri...@gmail.com>.
Hi Deepa,

You can add the request and response objects as in parameters to service to
get them inside the service.
<attribute name="request" mode="IN"
type="javax.servlet.http.HttpServletRequest"/>
<attribute name="response" mode="IN"
type="javax.servlet.http.HttpServletResponse"/>

get the request object from the context in side the service and from request
object get the session.
But it is not good to directly define the request and response object as in
parameter for the service. You will be always able to get all the parameters
from request/session by defining them as in parameter for the service.

--
Rishi Solanki
Manager, Enterprise Software Development
HotWax Media Pvt. Ltd.
Direct: +91-9893287847
http://www.hotwaxmedia.com


On Wed, Nov 17, 2010 at 4:50 PM, Deepa Priolkar <de...@techmahindra.com>wrote:

> Hi All,
>
>
>
> We are facing some issue related to the HTTP Session.
>
> How can we access the HTTP Session in the Ofbiz Services.
>
>
>
> Please let me know...
>
> Thanks & Regards,
>
> Deepa
>
>
> ============================================================================================================================Disclaimer:
>  This message and the information contained herein is proprietary and
> confidential and subject to the Tech Mahindra policy statement, you may
> review the policy at <a href="http://www.techmahindra.com/Disclaimer.html
> ">http://www.techmahindra.com/Disclaimer.html</a> externally and <a href="
> http://tim.techmahindra.com/Disclaimer.html">
> http://tim.techmahindra.com/Disclaimer.html</a> internally within Tech
> Mahindra.============================================================================================================================
>