public class WebExchangeDataBinder extends WebDataBinder
DataBinder
to perform data
binding from URL query parameters or form data in the request data to Java objects.
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.
DEFAULT_FIELD_DEFAULT_PREFIX, DEFAULT_FIELD_MARKER_PREFIX
DEFAULT_AUTO_GROW_COLLECTION_LIMIT, DEFAULT_OBJECT_NAME, logger
Constructor and Description |
---|
WebExchangeDataBinder(Object target)
Create a new instance, with default object name.
|
WebExchangeDataBinder(Object target,
String objectName)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected static void |
addBindValue(Map<String,Object> params,
String key,
List<?> values) |
reactor.core.publisher.Mono<Void> |
bind(ServerWebExchange exchange)
Bind query parameters, form data, or multipart form data to the binder target.
|
static reactor.core.publisher.Mono<Map<String,Object>> |
extractValuesToBind(ServerWebExchange exchange)
Combine query params and form data for multipart form data from the body
of the request into a
Map<String, Object> of values to use for
data binding purposes. |
reactor.core.publisher.Mono<Map<String,Object>> |
getValuesToBind(ServerWebExchange exchange)
Protected method to obtain the values for data binding.
|
adaptEmptyArrayIndices, bindMultipart, checkFieldDefaults, checkFieldMarkers, doBind, getEmptyValue, getEmptyValue, getFieldDefaultPrefix, getFieldMarkerPrefix, isBindEmptyMultipartFiles, setBindEmptyMultipartFiles, setFieldDefaultPrefix, setFieldMarkerPrefix
addCustomFormatter, addCustomFormatter, addCustomFormatter, addValidators, applyPropertyValues, bind, checkAllowedFields, checkRequiredFields, close, convertIfNecessary, convertIfNecessary, convertIfNecessary, convertIfNecessary, createBeanPropertyBindingResult, createDirectFieldBindingResult, findCustomEditor, getAllowedFields, getAutoGrowCollectionLimit, getBindingErrorProcessor, getBindingResult, getConversionService, getDisallowedFields, getInternalBindingResult, getObjectName, getPropertyAccessor, getPropertyEditorRegistry, getRequiredFields, getSimpleTypeConverter, getTarget, getTypeConverter, getValidator, getValidators, initBeanPropertyAccess, initDirectFieldAccess, isAllowed, isAutoGrowNestedPaths, isIgnoreInvalidFields, isIgnoreUnknownFields, registerCustomEditor, registerCustomEditor, replaceValidators, setAllowedFields, setAutoGrowCollectionLimit, setAutoGrowNestedPaths, setBindingErrorProcessor, setConversionService, setDisallowedFields, setIgnoreInvalidFields, setIgnoreUnknownFields, setMessageCodesResolver, setRequiredFields, setValidator, validate, validate
public WebExchangeDataBinder(@Nullable Object target)
target
- the target object to bind onto (or null
if the
binder is just used to convert a plain parameter value)DataBinder.DEFAULT_OBJECT_NAME
public reactor.core.publisher.Mono<Void> bind(ServerWebExchange exchange)
exchange
- the current exchangeMono<Void>
when binding is completepublic reactor.core.publisher.Mono<Map<String,Object>> getValuesToBind(ServerWebExchange exchange)
extractValuesToBind(ServerWebExchange)
.exchange
- the current exchangepublic static reactor.core.publisher.Mono<Map<String,Object>> extractValuesToBind(ServerWebExchange exchange)
Map<String, Object>
of values to use for
data binding purposes.exchange
- the current exchangeMono
with the values to bindServerHttpRequest.getQueryParams()
,
ServerWebExchange.getFormData()
,
ServerWebExchange.getMultipartData()