@Configurationpublic class SessionCheckInterceptor implements HandlerInterceptor {@Overridepublic boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)throws Exception {HttpSession httpSession = request.getSession();if(httpSession.getAttribute(Constant.SESSION_DEPT_SPACE_CODE)==null) {httpSession.setAttribute(Constant.SESSION_DEPT_SPACE_RELATION_DEPT_CODE, Constant.NO_RELATION_DEPT_CODE);httpSession.setAttribute(Constant.SESSION_DEPT_SPACE_CODE, Constant.NO_DEPT_SPACE_CODE);}// if(httpSession.getAttribute(Constant.SESSION_DGDPS_ROLE_TYPE)==null) {// httpSession.setAttribute(Constant.SESSION_DGDPS_ROLE_TYPE, DgdpsportalConstant.DGDPS_ROLE_TYPE_OTHER);// }return true;}}
springmvc中会调用
