BugFix ISSUE

http://blog.csdn.net/ly5156/article/details/7604813

if (requestType.Equals("ajax"))
            tips = "{\"result\" : false, \"message\" : \"未登录或者登陆超时,请重新登录。\"}";

http://www.2cto.com/kf/201304/199910.html//work?

项目中遇到这个问题:session-timeout后,操作左菜单原来页面,会弹出一个新的登录页面在target=“NT_PHVIEW”,而不是,一个新的整体登录页面,

 

解决方案:

         在我自定义的SessionFilter里加了这么一段代码:

  

package com.alu.gm.filter;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.*;
import javax.servlet.http.*;

import com.alu.gm.util.LdapUtil;

public class SessionFilter implements Filter
{
  public void init(FilterConfig fConfig) throws ServletException { }
 
  public void doFilter(ServletRequest req, ServletResponse res, FilterChain fChain) throws IOException, ServletException
  {
    HttpServletRequest  request     = (HttpServletRequest)req;
    HttpServletResponse response    = (HttpServletResponse)res;
    String              uri         = request.getRequestURI();
    String              contextPath = request.getContextPath();
    if (!uri.equals(contextPath+"/index.jsp")
     && !uri.equals(contextPath+"/LoginServlet")
     && !uri.equals(contextPath+"/LogoutServlet")
     && !uri.equals(contextPath+"/images/logo_alcatel-lucent-2lines.gif"))
    {
      HttpSession session = request.getSession(false);
      if (session == null || session.getAttribute(LdapUtil.LOGIN_PERSON) == null)  // Check if it has passed validation
      {
        clearCache(response);           // Clear cache before forwarding
//      request.getRequestDispatcher("/index.jsp").forward(request, response);
        PrintWriter out=res.getWriter();
        out.println("<script>");
        out.println("window.top.location.href='index.jsp';");
        out.println("</script>");
        return;
      }
    }
    fChain.doFilter(req, res);
  }
  /** Clear cache for client browser */
  public void clearCache(HttpServletResponse response)
  {
    response.setHeader("Pragma","No-cache");
    response.setHeader("Cache-Control","no-cache");  
    response.setDateHeader("Expires", -10);
  }
 
  public void destroy() { }

}


 

 

附网上资料:

关于js中window.location.href,location.href,parent.location.href,top.location.href的用法
"window.location.href"、"location.href"是本页面跳转.
"parent.location.href" 是上一层页面跳转.
"top.location.href" 是最外层的页面跳转.
举例说明:
    如果A,B,C,D都是html,D是C的iframe,C是B的iframe,B是A的iframe,如果D中js这样写
    "window.location.href"、"location.href":D页面跳转
    "parent.location.href":C页面跳转
    "top.location.href":A页面跳转
如果D页面中有form的话,
    <form>:  form提交后D页面跳转
    <form target="_blank">:  form提交后弹出新页面
    <form target="_parent">:  form提交后C页面跳转
    <form target="_top"> :  form提交后A页面跳转

如果访问的是iframe里面的页面,重新加载最外层的页面

<html>
<head>
<title></title>
<script language="javascript">
function escapeFrame(){
      if (window.top.location.href != window.location.href) {
        window.top.location.reload();
      }
}
</script>
</head>

<body onload="escapeFrame()">
<iframe src="b.html" ></iframe>
</body>
</html>

sessino time out : http://www.blogjava.net/ilovebabyfat/archive/2011/06/28/353272.html


var t = setTimeout("globalGrid.trigger('reloadGrid', [{page:1}])", 500);

 

UI : http://www.blublu.me/news/177086/?feed_sn=42&orderby=-id

 

CFG : 

<!-- 404错误响应页面
<error-page>
<error-code>404</error-code>
<location>/common/error/404.jsp</location>
</error-page>
-->
 
<!-- 500错误响应页面,如果想在客户端获取原始的异常堆栈信息则不要统一拦截500错误
<error-page>
<error-code>500</error-code>
<location>/common/error/500.jsp</location>
</error-page>
-->

你可能感兴趣的:(bug)