接口 RequestDataValueProcessor
public interface RequestDataValueProcessor
A contract for inspecting and potentially modifying request data values such as URL query parameters or form field values before they are rendered by a view or before a redirect.Implementations may use this contract for example as part of a solution to provide data integrity, confidentiality, protection against cross-site request forgery (CSRF), and others or for other tasks such as automatically adding a hidden field to all forms and URLs.
View technologies that support this contract can obtain an instance to delegate to via
RequestContext.getRequestDataValueProcessor()
.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 Map<String,String>
getExtraHiddenFields(ServerWebExchange exchange)
Invoked after all form fields have been rendered.String
processAction(ServerWebExchange exchange, String action, String httpMethod)
Invoked when a new form action is rendered.String
processFormFieldValue(ServerWebExchange exchange, String name, String value, String type)
Invoked when a form field value is rendered.String
processUrl(ServerWebExchange exchange, String url)
Invoked when a URL is about to be rendered or redirected to.
方法详细资料
processAction
String processAction(ServerWebExchange exchange, String action, String httpMethod)
Invoked when a new form action is rendered.- 参数:
exchange
- the current exchangeaction
- the form actionhttpMethod
- the form HTTP method- 返回:
- the action to use, possibly modified
processFormFieldValue
String processFormFieldValue(ServerWebExchange exchange, String name, String value, String type)
Invoked when a form field value is rendered.- 参数:
exchange
- the current exchangename
- the form field namevalue
- the form field valuetype
- the form field type ("text", "hidden", etc.)- 返回:
- the form field value to use, possibly modified
getExtraHiddenFields
@Nullable Map<String,String> getExtraHiddenFields(ServerWebExchange exchange)
Invoked after all form fields have been rendered.- 参数:
exchange
- the current exchange- 返回:
- additional hidden form fields to be added, or
null
processUrl
String processUrl(ServerWebExchange exchange, String url)
Invoked when a URL is about to be rendered or redirected to.- 参数:
exchange
- the current exchangeurl
- the URL value- 返回:
- the URL to use, possibly modified