Top Description Inners Constructors Methods
org.springframework.web.servlet.mvc.method.annotation

public Class ExtendedServletRequestDataBinder

extends ServletRequestDataBinder
Class Inheritance
Imports
java.util.Map, .Set, jakarta.servlet.ServletRequest, org.springframework.beans.MutablePropertyValues, org.springframework.lang.Nullable, org.springframework.web.bind.ServletRequestDataBinder, .WebDataBinder, org.springframework.web.servlet.HandlerMapping

Subclass of ServletRequestDataBinder that adds URI template variables to the values used for data binding.

Warning

Data binding can lead to security issues by exposing parts of the object graph that are not meant to be accessed or modified by external clients. Therefore the design and use of data binding should be considered carefully with regard to security. For more details, please refer to the dedicated sections on data binding for Spring Web MVC and Spring WebFlux in the reference manual.

Author
Rossen Stoyanchev
Since
3.1
See Also
ServletRequestDataBinder, HandlerMapping#URI_TEMPLATE_VARIABLES_ATTRIBUTE

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
ExtendedServletRequestDataBinder.ExtendedServletRequestValueResolver

Resolver of values that looks up URI path variables.

Constructor Summary

AccessConstructor and Description
public
ExtendedServletRequestDataBinder(Object
the target object to bind onto (or null if the binder is just used to convert a plain parameter value)
target
)

Create a new instance, with default object name.

public
ExtendedServletRequestDataBinder(Object
the target object to bind onto (or null if the binder is just used to convert a plain parameter value)
target
,
String
the name of the target object
objectName
)

Create a new instance.

Method Summary

Modifier and TypeMethod and Description
protected void
addBindValues(MutablePropertyValues
the property values that will be used for data binding
mpvs
,
ServletRequest
the current request
request
)

Overrides org.springframework.web.bind.ServletRequestDataBinder.addBindValues.

Merge URI variables into the property values to use for data binding.

protected ServletRequestDataBinder.ServletRequestValueResolver
private static Map<String, String>
Inherited from org.springframework.web.bind.ServletRequestDataBinder:
bindcloseNoCatchconstructshouldConstructArgumentvalueResolver

Constructor Detail

ExtendedServletRequestDataBinderback to summary
public ExtendedServletRequestDataBinder(Object target)

Create a new instance, with default object name.

Parameters
target:Object

the target object to bind onto (or null if the binder is just used to convert a plain parameter value)

See Also
DEFAULT_OBJECT_NAME
ExtendedServletRequestDataBinderback to summary
public ExtendedServletRequestDataBinder(Object target, String objectName)

Create a new instance.

Parameters
target:Object

the target object to bind onto (or null if the binder is just used to convert a plain parameter value)

objectName:String

the name of the target object

See Also
DEFAULT_OBJECT_NAME

Method Detail

addBindValuesback to summary
protected void addBindValues(MutablePropertyValues mpvs, ServletRequest request)

Overrides org.springframework.web.bind.ServletRequestDataBinder.addBindValues.

Merge URI variables into the property values to use for data binding.

Parameters
mpvs:MutablePropertyValues

Doc from org.springframework.web.bind.ServletRequestDataBinder.addBindValues.

the property values that will be used for data binding

request:ServletRequest

Doc from org.springframework.web.bind.ServletRequestDataBinder.addBindValues.

the current request

Annotations
@Override
createValueResolverback to summary
protected ServletRequestDataBinder.ServletRequestValueResolver createValueResolver(ServletRequest request)

Overrides org.springframework.web.bind.ServletRequestDataBinder.createValueResolver.

Doc from org.springframework.web.bind.ServletRequestDataBinder.createValueResolver.

Allow subclasses to create the ValueResolver instance to use.

Annotations
@Override
getUriVarsback to summary
private static Map<String, String> getUriVars(ServletRequest request)
Annotations
@SuppressWarnings:unchecked
@Nullable
org.springframework.web.servlet.mvc.method.annotation back to summary

private Class ExtendedServletRequestDataBinder.ExtendedServletRequestValueResolver

extends ServletRequestValueResolver
Class Inheritance

Resolver of values that looks up URI path variables.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected Object
protected Set<String>
Inherited from org.springframework.web.bind.ServletRequestDataBinder.ServletRequestValueResolver:
getNamesgetRequestresolveValue

Constructor Detail

ExtendedServletRequestValueResolverback to summary
pack-priv ExtendedServletRequestValueResolver(ServletRequest request, WebDataBinder dataBinder)

Method Detail

getRequestParameterback to summary
protected Object getRequestParameter(String name, Class<?> type)

Overrides org.springframework.web.bind.ServletRequestDataBinder.ServletRequestValueResolver.getRequestParameter.

Annotations
@Override
initParameterNamesback to summary
protected Set<String> initParameterNames(ServletRequest request)

Overrides org.springframework.web.bind.ServletRequestDataBinder.ServletRequestValueResolver.initParameterNames.

Annotations
@Override