夏日蓝雪 2012-07-04 16:07
浏览 784
已采纳

单点登录session丢失问题

最近在做一个移动的CRM项目,发现从4A系统跳转到CRM系统,2边都是测试环境session不会丢失。但是到了2边都是正式系统时,4A的用户信息已经传到CRM。CRM也保存了用户信息。短信也能正常收到。但是到跳转页面的时候,session丢失,直接到超时界面。代码如下:
//Action代码
ActionContext.getContext().getSession().put(WebConstant.SESSION_ATTRIBUTE_USER, user);
ActionContext.getContext().getSession().put("contactphone", operVO.getContactphone());
LoginMACTable.getInstance().put(user);//更新操作员工号对应的MAC地址
doGetSMSAndSend();//发送短信给操作员
return "index";
//过滤器代码
public void doFilter(ServletRequest req, ServletResponse rsp, FilterChain filterChain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) rsp;
String currentURL = request.getRequestURI();
String requestType = request.getHeader("x-requested-with");
//非ajax访问
if(null==requestType || !requestType.equals("XMLHttpRequest"))
{
if (isProtectedResource(currentURL)) {
User user = (User) request.getSession().getAttribute(WebConstant.SESSION_ATTRIBUTE_USER);
if (user != null) {
} else {request.getSession().invalidate();
String contextPath = request.getContextPath();
String errorStr = "top.location.href='" + contextPath + NO_SIGNON_PAGE + "';";
PrintWriter pw = response.getWriter();
pw.write(errorStr);
return;
}

//struts配置

    <global-results>
        <!-- 当返回login视图名时,转入/login.jsp页面 -->
        <result name="login">/login.jsp</result>
        <result name="login2">/login2.jsp</result>
        <result name="logout">/login.jsp</result>
        <result name="index" type="redirect">/index.jsp</result>
     </global-results>


/index.jsp

  • 写回答

2条回答 默认 最新

  • guazixing 2012-07-04 17:55
    关注

    说的不是很详细,使用的cas做的单点登录吧,你说的跳转页面是指什么?你保存用户信息的时候是否创建了session?你的CRM系统的正式环境是否进行了负载均衡?说一说详细情况吧。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?