Hi Amila,

As I understood session should maintain in server not client right? and is
these two Jsp pages reside in same web application? if they are in same web
app, one thing to notice is your session may be time out. make sure it is
not. you can try adding below code in your jsp2

<%@ page language="java" contentType="text/html" session="true" %>

the solution in thread [1] may be helpful for setting session variable.

http://www.experts-exchange.com/Programming/Misc/Q_21903762.html

Thanks

On Wed, Oct 22, 2014 at 7:29 PM, Manoj Gunawardena <[email protected]> wrote:

> Hi Amila,
>
> Use same httpContext object to create httpclient connections to test1 and
> test2 jsps.
>
> Thanks
>
>
> On Wed, Oct 22, 2014 at 5:45 PM, Godwin Amila Shrimal <[email protected]>
> wrote:
>
>> Hi,
>>
>> I am using org.apache.http.client.HttpClient to send http request, here I
>> want to maintain the session.
>>
>> Ex. I have a web application hosted in tomcat.  web app has a *test1.jsp*
>> which set session attribute *code. *there is a another JSP called
>> *test2.jsp* which get the session attribute *code *and print it*. *I use
>> HttpClient and send a request to *test1.jsp *and then *test2.jsp, *when
>> I call the *test2.jsp *it cannot get the session attribute *code *and
>> session is not maintained.
>>
>> Can anyone suggest a solution for this.
>>
>>
>> Thanks
>> Godwin
>>
>> --
>> *Godwin Amila Shrimal*
>> Senior Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: *+94772264165*
>> linkedin: *http://lnkd.in/KUum6D <http://lnkd.in/KUum6D>*
>> twitter: https://twitter.com/godwinamila
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Manoj Gunawardena
> Tech Lead
> WSO2, Inc.: http://wso2.com
> lean.enterprise.middleware
> Mobile : +94 77 2291643
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Lakshman Udayakantha
WSO2 Inc. www.wso2.com
lean.enterprise.middleware
Mobile: *0711241005*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to