Top Description Fields Constructors Methods
org.springframework.web.reactive.function.server.support

public Class ServerResponseResultHandler

extends Object
implements HandlerResultHandler, InitializingBean, Ordered
Class Inheritance
All Implemented Interfaces
org.springframework.core.Ordered, org.springframework.beans.factory.InitializingBean, org.springframework.web.reactive.HandlerResultHandler
Imports
java.util.Collections, .List, reactor.core.publisher.Mono, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered, org.springframework.http.codec.HttpMessageWriter, .ServerCodecConfigurer, org.springframework.util.Assert, .CollectionUtils, org.springframework.web.reactive.HandlerResult, .HandlerResultHandler, org.springframework.web.reactive.function.server.ServerResponse, org.springframework.web.reactive.result.view.ViewResolver, org.springframework.web.server.ServerWebExchange

HandlerResultHandler implementation that supports ServerResponses.
Author
Arjen Poutsma
Since
5.0

Field Summary

Modifier and TypeField and Description
private List<HttpMessageWriter<?>>
private int
private List<ViewResolver>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
afterPropertiesSet()

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, 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.

public int
getOrder()

Implements org.springframework.core.Ordered.getOrder.

Get the order value of this object.

public Mono<Void>
handleResult(ServerWebExchange
current server exchange
exchange
,
HandlerResult
the result from the handling
result
)

Implements org.springframework.web.reactive.HandlerResultHandler.handleResult.

Process the given result modifying response headers and/or writing data to the response.

public void
setMessageWriters(List<HttpMessageWriter<?>> configurer)

Configure HTTP message writers to serialize the request body with.

public void
setOrder(int order)

Set the order for this result handler relative to others.

public void
public boolean
supports(HandlerResult
the result object to check
result
)

Implements org.springframework.web.reactive.HandlerResultHandler.supports.

Whether this handler supports the given HandlerResult.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

messageWritersback to summary
private List<HttpMessageWriter<?>> messageWriters
orderback to summary
private int order
viewResolversback to summary
private List<ViewResolver> viewResolvers

Constructor Detail

ServerResponseResultHandlerback to summary
public ServerResponseResultHandler()

Method Detail

afterPropertiesSetback to summary
public void afterPropertiesSet() throws Exception

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Doc from org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, 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.

Annotations
@Override
Exceptions
Exception:
in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason
getOrderback to summary
public int getOrder()

Implements org.springframework.core.Ordered.getOrder.

Doc from org.springframework.core.Ordered.getOrder.

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.

Returns:int

the order value

Annotations
@Override
handleResultback to summary
public Mono<Void> handleResult(ServerWebExchange exchange, HandlerResult result)

Implements org.springframework.web.reactive.HandlerResultHandler.handleResult.

Doc from org.springframework.web.reactive.HandlerResultHandler.handleResult.

Process the given result modifying response headers and/or writing data to the response.

Parameters
exchange:ServerWebExchange

current server exchange

result:HandlerResult

the result from the handling

Returns:Mono<Void>

Mono<Void> to indicate when request handling is complete.

Annotations
@Override
setMessageWritersback to summary
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.

setOrderback to summary
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.

setViewResolversback to summary
public void setViewResolvers(List<ViewResolver> viewResolvers)
supportsback to summary
public boolean supports(HandlerResult result)

Implements org.springframework.web.reactive.HandlerResultHandler.supports.

Doc from org.springframework.web.reactive.HandlerResultHandler.supports.

Whether this handler supports the given HandlerResult.

Parameters
result:HandlerResult

the result object to check

Returns:boolean

whether this object can use the given result

Annotations
@Override