org.springframework.web.reactive.function.server.support

Class ServerResponseResultHandler

  • java.lang.Object
    • org.springframework.web.reactive.function.server.support.ServerResponseResultHandler
    • Constructor Detail

      • ServerResponseResultHandler

        public ServerResponseResultHandler()
    • Method Detail

      • setMessageWriters

        public void setMessageWriters(java.util.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(java.util.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()
        Description copied from interface: 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.

        Specified by:
        getOrder in interface Ordered
        Returns:
        the order value
        See Also:
        Ordered.HIGHEST_PRECEDENCE, Ordered.LOWEST_PRECEDENCE
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Description copied from interface: InitializingBean
        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.

        Specified by:
        afterPropertiesSet in interface InitializingBean
        Throws:
        java.lang.Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason
      • handleResult

        public reactor.core.publisher.Mono<java.lang.Void> handleResult(ServerWebExchange exchange,
                                                                        HandlerResult result)
        Description copied from interface: HandlerResultHandler
        Process the given result modifying response headers and/or writing data to the response.
        Specified by:
        handleResult in interface HandlerResultHandler
        Parameters:
        exchange - current server exchange
        result - the result from the handling
        Returns:
        Mono<Void> to indicate when request handling is complete.