public void doTag() throws JspException, IOException {
   // 从缓存中获取当前用户所能操作的所有的url
   SortedSet<String> urls = SessionHelper.getAuthWrap().getAuthUrlSet();
   if (CollectionUtils.isNotEmpty(urls)) {
     boolean flag = StringUtils.isNotBlank(UrlUtils.urlMatch(urls, getPath()));
     if (flag) {
       getJspContext().getOut().write(createStr());
     }
   }
 }
Exemplo n.º 2
0
 public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
     throws IOException, ServletException {
   HttpServletRequest httpRequest = (HttpServletRequest) request;
   // 如果在excludePath中,则跳过
   if (StringUtils.isNotBlank(
       UrlUtils.urlMatch(excludePathSet, RequestUtils.getReqPath(httpRequest)))) {
     chain.doFilter(request, response);
     return;
   }
   StopWatch stopWatch = new StopWatch();
   stopWatch.start();
   request.setAttribute(START_TIME, stopWatch);
   chain.doFilter(request, response);
   stopWatch.stop();
   if (null != request.getAttribute(START_TIME)) {
     logger.info(
         "URL[" + httpRequest.getRequestURI() + "]executeTime[" + stopWatch.toString() + "]");
   }
 }