code: public static <T> AttributeKey<T> requestScoped() {
          return new AttributeKey<T>() {
              public T get(HttpServletRequest req) {
                  return (T)req.getAttribute(name);
              }
  
              public void set(HttpServletRequest req, T value) {
                  req.setAttribute(name, value);
              }
  
              public void remove(HttpServletRequest req) {
                  req.removeAttribute(name);
              }
          };
      }
docs: Creates a new request-scoped {@link AttributeKey}.