1. controller Control Layer Code :... @ SessionTimeOutAnnotation @ RequestMapping (value = "findSumRainList. hd ") @ ResponseBodypublic List findSumRainList (HttpServletRequest request, HttpServletResponse response ){....}...
2. Verify the core code of the session Timeout Section/*** system cut point class, and define the system level cut point **/@ Aspect @ Componentpublic class SessionTimeOutAspect {public SessionTimeOutAspect () {}@ Before (value = "@ annotation (org. wh. aspectj. annotation. sessionTimeOutAnnotation) ") public void sessionTimeOutExceptionAspect (JoinPoint jp) throws Exception {User user = null; for (Object param: jp. getArgs () {if (param instanceof HttpServletRequest) {user = (User) (H TtpServletRequest) param). getSession (). getAttribute (SystemConstants. SESSION_USER); break ;}} if (user = null) {throw new RuntimeException ("Operation timed out, please log on again! ");}}...} 3. js global function. The core capture Exception Code: function errAjaxEvent () {// use the normal page // $ ("body "). ajaxError (function (event, request, ajaxOptions, thrownError) {// use frame framework $ (parent. frames ["frame_main" example .doc ument ). ajaxError (function (event, request, ajaxOptions, thrownError) {try {if (request. responseText. indexOf ('Log On again ')> 0) {art. dialog ({title: 'hprompt ', content:' login timeout. Please log on again! ', Icon: 'warning', lock: true, OK: function () {window. parent. location. href = '.. /login. hd ';}}) ;}} catch (e) {}});} 4. web. xml...
30
Login. hd
...