类 ServerResponseResultHandler
- java.lang.Object
- org.springframework.web.reactive.function.server.support.ServerResponseResultHandler
- 所有已实现的接口:
InitializingBean
,Ordered
,HandlerResultHandler
public class ServerResponseResultHandler extends Object implements HandlerResultHandler, InitializingBean, Ordered
HandlerResultHandler
implementation that supportsServerResponses
.- 从以下版本开始:
- 5.0
- 作者:
- Arjen Poutsma
字段概要
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 构造器 说明 ServerResponseResultHandler()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.int
getOrder()
Get the order value of this object.reactor.core.publisher.Mono<Void>
handleResult(ServerWebExchange exchange, HandlerResult result)
Process the given result modifying response headers and/or writing data to the response.void
setMessageWriters(List<HttpMessageWriter<?>> configurer)
Configure HTTP message writers to serialize the request body with.void
setOrder(int order)
Set the order for this result handler relative to others.void
setViewResolvers(List<ViewResolver> viewResolvers)
boolean
supports(HandlerResult result)
Whether this handler supports the givenHandlerResult
.
构造器详细资料
ServerResponseResultHandler
public ServerResponseResultHandler()
方法详细资料
setMessageWriters
public void setMessageWriters(List<HttpMessageWriter<?>> configurer)
Configure HTTP message writers to serialize the request body with.By default this is set to
ServerCodecConfigurer
's default writers.
setViewResolvers
public void setViewResolvers(List<ViewResolver> viewResolvers)
setOrder
public void setOrder(int order)
Set the order for this result handler relative to others.By default set to 0. It is generally safe to place it early in the order as it looks for a concrete return type.
getOrder
public int getOrder()
从接口复制的说明:Ordered
Get the order value of this object.Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet
load-on-startup
values).Same order values will result in arbitrary sort positions for the affected objects.
- 指定者:
getOrder
在接口中Ordered
- 返回:
- the order value
- 另请参阅:
Ordered.HIGHEST_PRECEDENCE
,Ordered.LOWEST_PRECEDENCE
afterPropertiesSet
public void afterPropertiesSet() throws Exception
从接口复制的说明:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- 指定者:
afterPropertiesSet
在接口中InitializingBean
- 抛出:
Exception
- in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason
supports
public boolean supports(HandlerResult result)
从接口复制的说明:HandlerResultHandler
Whether this handler supports the givenHandlerResult
.- 指定者:
supports
在接口中HandlerResultHandler
- 参数:
result
- the result object to check- 返回:
- whether or not this object can use the given result
handleResult
public reactor.core.publisher.Mono<Void> handleResult(ServerWebExchange exchange, HandlerResult result)
从接口复制的说明:HandlerResultHandler
Process the given result modifying response headers and/or writing data to the response.- 指定者:
handleResult
在接口中HandlerResultHandler
- 参数:
exchange
- current server exchangeresult
- the result from the handling- 返回:
Mono<Void>
to indicate when request handling is complete.