论坛首页 入门技术论坛

sso模拟登陆在tomcat上正常,在websphere上却不正常

浏览 3609 次
该帖已经被评为新手帖
作者 正文
   发表时间:2008-07-20  
我采用的是httpclient的方式模拟登陆,然后再获取sessionid,再redirect到相应的页面,代码:
HttpClient client = new HttpClient();
		
PostMethod method = new PostMethod("url");
		
method.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
		
method.setRequestHeader("Cookie", "JSESSIONID=" + sSesId);
method.setRequestBody(param);
try{
      int statusCode = client.executeMethod(method);

   } catch (Exception e) {
	e.printStackTrace();
   } finally {
	method.releaseConnection();
   }


在tomcat下正常没有问题,但是在websphere下我跟踪到
sessionid是和登陆时一个sessionid,但是当session.getAttribute()时却为null,不知为什么??
   发表时间:2008-07-21  
朋友,我和你遇到了同样的问题,你的问题解决了吗?


0 请登录后投票
   发表时间:2008-07-22  
为什么从 JavaEye 提了问题总是没人回答呢,是因为问题太简单了吗?
0 请登录后投票
   发表时间:2008-08-27  
把你的sessionid前面增加上0000试试看。
0 请登录后投票
   发表时间:2009-02-18  
可以改用url rewrite试试看
0 请登录后投票
论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics