} else {
userId = (String) req.getSession(true).getAttribute("__USER_ID__");
}
if (userId != null) {
// 檢查此用戶是否在黑名單中
BlackItem item = BlackListServices.getInstance()
.findBlackItemByUserId(userId);
if (item != null) {
// forward or redirect
logger.info("callback.URL=" + item.getCallbackURL());
if (!(req.getRequestURL().toString()).endsWith(item.getCallbackURL())) {
res.sendRedirect(item.getCallbackURL());
return;
}
}
}
chain.doFilter(request, response);