private String getPath(ServletServerHttpRequest request) {
   String path =
       (String)
           request
               .getServletRequest()
               .getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);
   return (path == null ? "" : path);
 }
 private void beforeBodyWrite(Object body, ServletServerHttpRequest request) {
   Object pattern =
       request
           .getServletRequest()
           .getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);
   if (pattern != null && body instanceof ResourceSupport) {
     beforeBodyWrite(pattern.toString(), (ResourceSupport) body);
   }
 }