Hi,

In article <[EMAIL PROTECTED]>,
Tue, 13 Sep 2005 15:04:51 +0900,
[EMAIL PROTECTED] wrote: 
liu_hongying> I have run the following code at Tomcat 5.0 and I got the 
sessionCookie, 
liu_hongying> but when I run 
liu_hongying> it at websphere 6, sessionCookie become null. so I can't continue 
the 
liu_hongying> test.

liu_hongying> 
liu_hongying>     public void beginSuccessForward(WebRequest theRequest) {
liu_hongying> 
liu_hongying>         HttpSessionCookie sessionCookie = 
theRequest.getSessionCookie();
liu_hongying>         assertNotNull("Session cookie should not be null", 
sessionCookie);
liu_hongying>         theRequest.addCookie(sessionCookie);
liu_hongying>      }

This test is depending on server implementation and/or configuration.

Server can delay to issuing JSESSIONID until it is really needed.
AFAIK, Tomcat issues JESSIONID for the first request by default
(this is why your test works with Tomcat).
However, other container, such as WebSphere, may not.
# I'm not sure how WebSphere works.

If you need a valid session for testXXX method,
WebRequest#setAutomaticSession(boolean) may helps you.

Hope this helps,
----
Kazuhito SUGURI

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to