spring的拦截器(MethodInterceptor)做权限验证,怎么判断session里是否有值
spring的拦截器(MethodInterceptor)做权限验证,判断session里是否有值,可是拦截器里得不到session啊,怎么办?
public class chkLoginAdvice implements MethodInterceptor{
//得不到session啊
}
------解决方案--------------------
public class xxxSessionInterceptor extends HandlerInterceptorAdapter
{
public boolean preHandle(HttpServletRequest request,HttpServletResponse response,Object handler)
这里处理就可以~