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:
- HandlerMethodArgumentResolver
public class ServletCookieValueMethodArgumentResolver
extends AbstractCookieValueMethodArgumentResolver
An 
AbstractCookieValueMethodArgumentResolver
 that resolves cookie values from an HttpServletRequest.- Since:
- 3.1
- Author:
- Rossen Stoyanchev
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolverAbstractNamedValueMethodArgumentResolver.NamedValueInfo
- 
Constructor SummaryConstructorsConstructorDescription
- 
Method SummaryModifier and TypeMethodDescriptionresolveName(String cookieName, MethodParameter parameter, NativeWebRequest webRequest) Resolve the given parameter type and value name into an argument value.voidsetUrlDecode(boolean urlDecode) Whether to apply URL decoding to cookie values viaUrlPathHelper.decodeRequestString(HttpServletRequest, String).voidsetUrlPathHelper(UrlPathHelper urlPathHelper) Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class org.springframework.web.method.annotation.AbstractCookieValueMethodArgumentResolvercreateNamedValueInfo, handleMissingValue, handleMissingValueAfterConversion, supportsParameterMethods inherited from class org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolverhandleMissingValue, handleResolvedValue, resolveArgument
- 
Constructor Details- 
ServletCookieValueMethodArgumentResolver
 
- 
- 
Method Details- 
setUrlDecodepublic void setUrlDecode(boolean urlDecode) Whether to apply URL decoding to cookie values viaUrlPathHelper.decodeRequestString(HttpServletRequest, String). A shortcut for doing the same by setting aUrlPathHelperwith itsurlDecodeproperty set accordingly.By default, set to "true" in which case cookie values are decoded. - Since:
- 6.1.2
 
- 
setUrlPathHelperDeprecated, for removal: This API element is subject to removal in a future version.use ofPathMatcherandUrlPathHelperis deprecated for use at runtime in web modules in favor of parsed patterns withPathPatternParser.Set theUrlPathHelperto use to decode cookie values with viaUrlPathHelper.decodeRequestString(HttpServletRequest, String). For most cases you can usesetUrlDecode(boolean)instead.
- 
resolveNameprotected @Nullable Object resolveName(String cookieName, MethodParameter parameter, NativeWebRequest webRequest) throws Exception Description copied from class:AbstractNamedValueMethodArgumentResolverResolve the given parameter type and value name into an argument value.- Specified by:
- resolveNamein class- AbstractNamedValueMethodArgumentResolver
- Parameters:
- cookieName- the name of the value being resolved
- parameter- the method parameter to resolve to an argument value (pre-nested in case of a- Optionaldeclaration)
- webRequest- the current request
- Returns:
- the resolved argument (may be null)
- Throws:
- Exception- in case of errors
 
 
- 
PathMatcherandUrlPathHelperis deprecated for use at runtime in web modules in favor of parsed patterns withPathPatternParser.