Class ServletCookieValueMethodArgumentResolver

java.lang.Object
org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver
org.springframework.web.method.annotation.AbstractCookieValueMethodArgumentResolver
org.springframework.web.servlet.mvc.method.annotation.ServletCookieValueMethodArgumentResolver
All Implemented Interfaces:
org.springframework.web.method.support.HandlerMethodArgumentResolver

public class ServletCookieValueMethodArgumentResolver extends org.springframework.web.method.annotation.AbstractCookieValueMethodArgumentResolver
An AbstractCookieValueMethodArgumentResolver that resolves cookie values from an HttpServletRequest.
Since:
3.1
Author:
Rossen Stoyanchev
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver

    org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.NamedValueInfo
  • Constructor Summary

    Constructors
    Constructor
    Description
    ServletCookieValueMethodArgumentResolver(@Nullable org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected @Nullable Object
    resolveName(String cookieName, org.springframework.core.MethodParameter parameter, org.springframework.web.context.request.NativeWebRequest webRequest)
     
    void
    setUrlDecode(boolean urlDecode)
    Whether to apply URL decoding to cookie values via UrlPathHelper.decodeRequestString(HttpServletRequest, String).
    void
    setUrlPathHelper(org.springframework.web.util.UrlPathHelper urlPathHelper)
    Deprecated, for removal: This API element is subject to removal in a future version.
    use of PathMatcher and UrlPathHelper is deprecated for use at runtime in web modules in favor of parsed patterns with PathPatternParser.

    Methods inherited from class org.springframework.web.method.annotation.AbstractCookieValueMethodArgumentResolver

    createNamedValueInfo, handleMissingValue, handleMissingValueAfterConversion, supportsParameter

    Methods inherited from class org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver

    handleMissingValue, handleResolvedValue, resolveArgument

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ServletCookieValueMethodArgumentResolver

      public ServletCookieValueMethodArgumentResolver(@Nullable org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory)
  • Method Details

    • setUrlDecode

      public void setUrlDecode(boolean urlDecode)
      Whether to apply URL decoding to cookie values via UrlPathHelper.decodeRequestString(HttpServletRequest, String). A shortcut for doing the same by setting a UrlPathHelper with its urlDecode property set accordingly.

      By default, set to "true" in which case cookie values are decoded.

      Since:
      6.1.2
    • setUrlPathHelper

      @Deprecated(since="7.0", forRemoval=true) public void setUrlPathHelper(org.springframework.web.util.UrlPathHelper urlPathHelper)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use of PathMatcher and UrlPathHelper is deprecated for use at runtime in web modules in favor of parsed patterns with PathPatternParser.
      Set the UrlPathHelper to use to decode cookie values with via UrlPathHelper.decodeRequestString(HttpServletRequest, String). For most cases you can use setUrlDecode(boolean) instead.
    • resolveName

      protected @Nullable Object resolveName(String cookieName, org.springframework.core.MethodParameter parameter, org.springframework.web.context.request.NativeWebRequest webRequest) throws Exception
      Specified by:
      resolveName in class org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver
      Throws:
      Exception