各类拦截器的传统写法案例:
1 在spring-mvc.xml 文件中添加 拦截器 如下:
<!-- 通用拦截器配置 -->
<mvc:interceptors>
...
...
<mvc:interceptor>
<mvc:mapping path="/data/**"/>
<bean class="com.icinfo.system.interceptor.NotLoggedInToIntercept"/>
</mvc:interceptor>
</mvc:interceptors>
2 拦截器类编写如下:
package com.icinfo.system.interceptor;
import com.icinfo.support.constants.Constants;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
* 描述 未登录认证访问拦截
*
* @author
* @date 2018/11/8
*/
public class NotLoggedInToIntercept imple