Top Description Fields Constructors Methods
org.springframework.web.bind

public Class ServletRequestParameterPropertyValues

extends MutablePropertyValues
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
jakarta.servlet.ServletRequest, org.springframework.beans.MutablePropertyValues, org.springframework.lang.Nullable, org.springframework.web.util.WebUtils

PropertyValues implementation created from parameters in a ServletRequest. Can look for all property values beginning with a certain prefix and prefix separator (default is "_").

For example, with a prefix of "spring", "spring_param1" and "spring_param2" result in a Map with "param1" and "param2" as keys.

This class is not immutable to be able to efficiently remove property values that should be ignored for binding.

Authors
Rod Johnson, Juergen Hoeller
See Also
org.springframework.web.util.WebUtils#getParametersStartingWith

Field Summary

Modifier and TypeField and Description
public static final String
DEFAULT_PREFIX_SEPARATOR

Default prefix separator.

Constructor Summary

AccessConstructor and Description
public
ServletRequestParameterPropertyValues(ServletRequest
the HTTP request
request
)

Create new ServletRequestPropertyValues using no prefix (and hence, no prefix separator).

public
ServletRequestParameterPropertyValues(ServletRequest
the HTTP request
request
,
String
the prefix for parameters (the full prefix will consist of this plus the separator)
prefix
)

Create new ServletRequestPropertyValues using the given prefix and the default prefix separator (the underscore character "_").

public
ServletRequestParameterPropertyValues(ServletRequest
the HTTP request
request
,
String
the prefix for parameters (the full prefix will consist of this plus the separator)
prefix
,
String
separator delimiting prefix (e.g. "spring") and the rest of the parameter name ("param1", "param2")
prefixSeparator
)

Create new ServletRequestPropertyValues supplying both prefix and prefix separator.

Method Summary

Inherited from org.springframework.beans.MutablePropertyValues:
addaddPropertyValueaddPropertyValueaddPropertyValuesaddPropertyValueschangesSinceclearProcessedPropertycontainsequalsgetgetPropertyValuegetPropertyValueListgetPropertyValueshashCodeisConvertedisEmptyiteratorregisterProcessedPropertyremovePropertyValueremovePropertyValuesetConvertedsetPropertyValueAtsizespliteratorstreamtoString

Field Detail

DEFAULT_PREFIX_SEPARATORback to summary
public static final String DEFAULT_PREFIX_SEPARATOR

Default prefix separator.

Constructor Detail

ServletRequestParameterPropertyValuesback to summary
public ServletRequestParameterPropertyValues(ServletRequest request)

Create new ServletRequestPropertyValues using no prefix (and hence, no prefix separator).

Parameters
request:ServletRequest

the HTTP request

ServletRequestParameterPropertyValuesback to summary
public ServletRequestParameterPropertyValues(ServletRequest request, String prefix)

Create new ServletRequestPropertyValues using the given prefix and the default prefix separator (the underscore character "_").

Parameters
request:ServletRequest

the HTTP request

prefix:String

the prefix for parameters (the full prefix will consist of this plus the separator)

See Also
DEFAULT_PREFIX_SEPARATOR
ServletRequestParameterPropertyValuesback to summary
public ServletRequestParameterPropertyValues(ServletRequest request, String prefix, String prefixSeparator)

Create new ServletRequestPropertyValues supplying both prefix and prefix separator.

Parameters
request:ServletRequest

the HTTP request

prefix:String

the prefix for parameters (the full prefix will consist of this plus the separator)

prefixSeparator:String

separator delimiting prefix (e.g. "spring") and the rest of the parameter name ("param1", "param2")