jiazx0107@163.com
2023-05-17 620eab6cca2bc9ef9ea6d3067a0a5ba1deadbd1c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.ld.igds.adepter;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
 
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;
 
/**
 * 
 * @author: andy.jia
 * @description: 会话超时拦截处理
 * @version:
 * @data:2019年12月9日
 *
 */
//@ControllerAdvice
public class MyExceptionHandler {
    
    
    /**
     * 出现会话超时异常
     * @param request
     * @param response
     * @param e
     * @return
     * @throws Exception
     */
    @ExceptionHandler(value = Exception.class)
    public Object sessionTimout(HttpServletRequest request,
            HttpServletResponse response, Exception e) throws Exception {
        ModelAndView mav = new ModelAndView();
        mav.setViewName("timeout");
        return mav;
    }
 
}