Returns a map with all request attributes.<p>

@param req the request

@return the attribute map
488716
public static Map<String, Object> getAttributeMap(ServletRequest req) {

        if (req instanceof CmsFlexRequest) {
            return ((CmsFlexRequest)req).getAttributeMap();
        }
        Map<String, Object> attrs = new HashMap<String, Object>();
        Enumeration<String> atrrEnum = CmsCollectionsGenericWrapper.enumeration(req.getAttributeNames());
        while (atrrEnum.hasMoreElements()) {
            String key = atrrEnum.nextElement();
            Object value = req.getAttribute(key);
            attrs.put(key, value);
        }
        return attrs;
    }
180395
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
    private static Map<String, List<Request>> asMap(
        final Collection<Request> reqs) throws IOException {
        final Map<String, List<Request>> map = new HashMap<>(reqs.size());
        for (final Request req : reqs) {
            final String header =
                new RqHeaders.Smart(req).single("Content-Disposition");
            final Matcher matcher = RqMtBase.NAME.matcher(header);
            if (!matcher.matches()) {
                throw new HttpException(
                    HttpURLConnection.HTTP_BAD_REQUEST,
                    String.format(
                        "\"name\" not found in Content-Disposition header: %s",
                        header
                    )
                );
            }
            final String name = matcher.group(1);
            if (!map.containsKey(name)) {
                map.put(name, new LinkedList<>());
            }
            map.get(name).add(req);
        }
        return map;
    }
452370
protected Map<URI, AttributeValue> getEnvironment(HttpServletRequest request) {
        Map<URI, AttributeValue> envAttr = new HashMap<URI, AttributeValue>();
        String ip = request.getRemoteAddr();

        if (ip != null && !ip.isEmpty()) {
            envAttr.put(Constants.HTTP_REQUEST.CLIENT_IP_ADDRESS.getURI(),
                    new StringAttribute(ip));
        }

        return envAttr;
    }
378044
def _create_request_map(cls, input_map):
        """"""
        field_map = cls._get_attributes_map()
        return {field_map[k]: v for k, v in input_map.items() if k in field_map}
298633
@Override
    public Map<String, List<Object>> getAttributes() {
        for (final IAdditionalDescriptors additionalDescriptors : delegateDescriptors) {
            final Map<String, List<Object>> attributes = additionalDescriptors.getAttributes();
            if (attributes != null && !attributes.isEmpty()) {
                return attributes;
            }
        }

        return Collections.emptyMap();
    }
1233297
public java.util.Map<java.lang.String, org.tensorflow.framework.AttrValue> getAttrMap() {
    return internalGetAttr().getMap();
  }
239690
@Override
    public MapAttribute<? super X, ?, ?> getMap(String paramName)
    {
        PluralAttribute<? super X, ?, ?> declaredAttrib = getDeclaredPluralAttribute(paramName);

        if (isMapAttribute(declaredAttrib))
        {
            return (MapAttribute<X, ?, ?>) declaredAttrib;
        }

        declaredAttrib = getPluralAttriute(paramName);

        if (isMapAttribute(declaredAttrib))
        {
            return (MapAttribute<X, ?, ?>) declaredAttrib;
        }

        throw new IllegalArgumentException(
                "attribute of the given name and type is not present in the managed type, for name:" + paramName);
    }
151666
@Override
    public Map<String, List<String>> parameters() {
        Map<String, List<String>> result = new HashMap<>();
        for (String key : request.params().names()) {
            result.put(key, request.params().getAll(key));
        }
        return result;
    }
128711
public static Map<String, Object> createRequestParamsMap(HttpServletRequest request) {
        Map<String, Object> paramsMap = new HashMap<>();
        for (Enumeration paramNameEnum = request.getParameterNames(); paramNameEnum.hasMoreElements(); ) {
            String paramName = (String)paramNameEnum.nextElement();
            String[] paramValues = request.getParameterValues(paramName);

            if (paramValues.length == 1) {
                paramsMap.put(paramName, paramValues[0]);
            } else {
                paramsMap.put(paramName, paramValues);
            }
        }

        return paramsMap;
    }
498282
@SuppressWarnings({ "unchecked", "rawtypes" })
    public Map<String, String> getAttributes() {
        return (Map) this.get(CloudTrailEventField.attributes.name());
    }
634826
public void dumpRequest(final HttpServletRequest req) {
    try {
      Enumeration names = req.getHeaderNames();

      String title = "Request headers";

      debug(title);

      while (names.hasMoreElements()) {
        String key = (String)names.nextElement();
        String val = req.getHeader(key);
        debug("  " + key + " = \"" + val + "\"");
      }

      names = req.getParameterNames();

      title = "Request parameters";

      debug(title + " - global info and uris");
      debug("getRemoteAddr = " + req.getRemoteAddr());
      debug("getRequestURI = " + req.getRequestURI());
      debug("getRemoteUser = " + req.getRemoteUser());
      debug("getRequestedSessionId = " + req.getRequestedSessionId());
      debug("HttpUtils.getRequestURL(req) = " + req.getRequestURL());
      debug("contextPath=" + req.getContextPath());
      debug("query=" + req.getQueryString());
      debug("contentlen=" + req.getContentLength());
      debug("request=" + req);
      debug("parameters:");

      debug(title);

      while (names.hasMoreElements()) {
        String key = (String)names.nextElement();
        String val = req.getParameter(key);
        debug("  " + key + " = \"" + val + "\"");
      }
    } catch (Throwable t) {
    }
  }
701335
public Map<String, String> getImageAttributes(Map<String, String> attributes) {

        return m_form.getImageAttributes(attributes);
    }
533961
protected Map<String, Object> getModelAttributes(final Map<String, Object> model) {
        return (Map<String, Object>) model.get(CasProtocolConstants.VALIDATION_CAS_MODEL_ATTRIBUTE_NAME_ATTRIBUTES);
    }
529185
public static Map<String, Object> getRequestParameters(final Collection<String> attributes, final HttpServletRequest context) {
        return attributes.stream()
            .filter(a -> StringUtils.isNotBlank(context.getParameter(a)))
            .map(m -> {
                val values = context.getParameterValues(m);
                val valuesSet = new LinkedHashSet<Object>();
                if (values != null && values.length > 0) {
                    Arrays.stream(values).forEach(v -> valuesSet.addAll(Arrays.stream(v.split(" ")).collect(Collectors.toSet())));
                }
                return Pair.of(m, valuesSet);
            })
            .collect(Collectors.toMap(Pair::getKey, Pair::getValue));
    }
122571
protected static Map<String, Object> getSessionAttributes(){
        //TODO: cache session attributes map since this method can be called multiple times during a request.

        HttpSession session = RequestContext.getHttpRequest().getSession(true);
        Enumeration names = session.getAttributeNames();
        Map<String, Object> values = new HashMap<>();
        while (names.hasMoreElements()) {
            Object name = names.nextElement();
            values.put(name.toString(), session.getAttribute(name.toString()));
        }
        return values;
    }
713928
public static String self(HttpServletRequest req) {
	StringBuffer sb = new StringBuffer(req.getServletPath());
	String qs = req.getQueryString();
	if (!StringUtil.isEmpty(qs)) sb.append('?').append(qs);
	return sb.toString();
    }
528184
private Map<String, String> getMapping() {
    if (this.attributesMapping != null && this.lastReload != null && this.lastReload.equals(this.attributeResolverService
      .getLastSuccessfulReloadInstant())) {
      return this.attributesMapping;
    }
    // Reload.
    ServiceableComponent<AttributeResolver> component = null;
    Map<String, String> am = null;
    try {
      // Get date before we get the component. That way we'll not leak changes.
      final DateTime when = this.attributeResolverService.getLastSuccessfulReloadInstant();
      component = this.attributeResolverService.getServiceableComponent();
      if (null == component) {
        if (!captiveServiceReloadFailed) {
          logger.error("Invalid AttributeResolver configuration");
        }
        captiveServiceReloadFailed = true;
      }
      else {
        final AttributeResolver attributeResolver = component.getComponent();
        am = new HashMap<>();

        Map<String, AttributeDefinition> map = attributeResolver.getAttributeDefinitions();
        for (Map.Entry<String, AttributeDefinition> entry : map.entrySet()) {
          String name = null;
          Set<AttributeEncoder<?>> encoders = entry.getValue().getAttributeEncoders();
          for (AttributeEncoder<?> encoder : encoders) {
            if (encoder instanceof SAML2AttributeEncoder) {
              name = ((SAML2AttributeEncoder<?>) encoder).getName();
              if (name != null) {
                break;
              }
            }
          }
          if (name != null) {
            logger.debug("Adding mapping between SAML2 attribute '{}' and id '{}'", name, entry.getKey());
            am.put(name, entry.getKey());
          }
          else {
            logger.debug("No mapping to SAML2 attribute for attribute id '{}'", entry.getKey());
          }
        }

        captiveServiceReloadFailed = false;
        lastReload = when;
      }
    }
    finally {
      if (null != component) {
        component.unpinComponent();
      }
    }

    this.attributesMapping = am;
    return am;
  }