We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
public class CustomInterceptor implements HandlerInterceptor { @reference(version = "1.0.0") private SessionProvider sessionProvider;
@Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { log.info("CustomInterceptor preHandle start."); //用户必须登录 String uername = sessionProvider.getAttributeForUser(RequestUtil.getCSESSIONID(request, response)); //未登录 if (StringUtils.isBlank(uername)) { return false; } log.info("CustomInterceptor preHandle end."); return true; } @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { log.info("CustomInterceptor postHandle."); } @Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { log.info("CustomInterceptor afterCompletion."); }
}
The text was updated successfully, but these errors were encountered:
应该是消费者的扫描包没有扫到这个拦截器的目录,而且拦截器不能手动new喔: spring.dubbo.scan=要包括这个拦截器的包
spring.dubbo.scan=要包括这个拦截器的包
Sorry, something went wrong.
No branches or pull requests
public class CustomInterceptor implements HandlerInterceptor {
@reference(version = "1.0.0")
private SessionProvider sessionProvider;
}
The text was updated successfully, but these errors were encountered: