code: private static Object getPrivateAttributes(HttpServletRequest req, String key) {
          HttpServletRequest sr = req;
          if (sr instanceof HttpServletRequestWrapper) {
              HttpServletRequestWrapper w = (HttpServletRequestWrapper) sr;
              sr = (HttpServletRequest) w.getRequest();
              while (sr != null && sr instanceof HttpServletRequestWrapper)
                  sr = (HttpServletRequest) ((HttpServletRequestWrapper) sr).getRequest();
          }
          if (sr != null && sr instanceof IPrivateRequestAttributes) {
              return ((IPrivateRequestAttributes) sr).getPrivateAttribute(key);
          }
          return null;
      }
docs: TODO find a good home somewhere