1. 07 9月, 2016 1 次提交
    • B
      Add ResolvedResource in resource handling chain · ccb3c44d
      Brian Clozel 提交于
      Prior to this commit, the resource handling chain and its
      `ResourceResolvers` would use specific `Resource` implementations in
      order to add resource metadata to the HTTP response. For example,
      `VersionedResource` and `EncodedResource` are both adding specific HTTP
      response headers.
      
      This commit aims at making this mechanism more stable and reusable,
      since the previous implementation would fail in case a resolved resource
      would be both a `VersionedResource` wrapping a `EncodedResource` (or the
      other way arount). Only one of the specific implementations would
      contribute its metadata since the code supporting that in
      `ResourceHttpRequestHandler` would only check for `instanceof` tests,
      whereas those implementations are acutally delegating calls to
      the wrapped resource.
      
      Now both `VersionedResource` and `EncodedResource` have been replaced by
      specific implementations of `ResolvedResource`, which directly provides
      those HTTP response headers as part of `getResponseHeaders()`.
      
      This commit applies the same changes for the web reactive
      implementations and its `ResourceWebHandler`.
      
      Issue: SPR-14264
      ccb3c44d
  2. 06 9月, 2016 2 次提交
  3. 03 9月, 2016 1 次提交
    • B
      Fix null body handling in ResponseEntityResultHandler · 01bd8b9e
      Brian Clozel 提交于
      This commit fixes `ResponseEntityResultHandler` so that it only tries to
      call `writeBody` if the `ResponseEntity` is not null. In case the
      response entity body is null, the response is flushed right away and the
      request is signaled as handled.
      
      Issue: SPR-14663
      01bd8b9e
  4. 02 9月, 2016 3 次提交
  5. 01 9月, 2016 3 次提交
    • S
      Polishing · b4641b23
      Sebastien Deleuze 提交于
      b4641b23
    • A
      Introduce new functional web API · f1319f58
      Arjen Poutsma 提交于
      This commit introduces a new, functional web programming model in the
      org.springframework.web.reactive.function package. The key types
      are:
      
       - Request and Response are new Java 8-DSLs for access to the HTTP
         request and response
       - HandlerFunction represents a function to handle a request to a
         response
       - RoutingFunction maps a request to a HandlerFunction
       - FilterFunction filters a routing as defined by a RoutingFunction
       - RequestPredicate is used by Router to create RoutingFunctions
       - RequestPredicates offers common RequestPredicate instances
      f1319f58
    • A
      Refactored SseEvent to ServerSentEvent · 16b525f6
      Arjen Poutsma 提交于
       - Renamed SseEvent to ServerSentEvent to make the name less redundant.
       - ServerSentEvent is now immutable, having a builder to create new instances.
       - Realigned the class properties to more closely match the events
         described in the spec, so that `reconnectTime` becomes `retry`, and
         `name` becomes `event`.
      16b525f6
  6. 31 8月, 2016 3 次提交
  7. 30 8月, 2016 1 次提交
    • B
      Don't wrap resolver exceptions in InvocableHandlerMethod · 960d335c
      Brian Clozel 提交于
      Prior to this commit, exceptions thrown by the
      `HandlerMethodArgumentResolver` would be wrapped into
      `IllegalStateException`s.
      
      This commit makes sure that a DEBUG log is written with the relevant
      information and that the root cause is not wrapped into another
      exception, so that the appropriate `ExceptionHandler` can be used to
      deal with this error.
      
      Issue: SPR-14618
      960d335c
  8. 29 8月, 2016 1 次提交
  9. 09 8月, 2016 1 次提交
  10. 28 7月, 2016 3 次提交
    • R
      Shorten getter for ReactiveAdapterRegistry · 460ed307
      Rossen Stoyanchev 提交于
      460ed307
    • R
      Add support for rx.Completable as return value · 143b5c89
      Rossen Stoyanchev 提交于
      143b5c89
    • R
      Remove SimpleResultHandler · 79bc227c
      Rossen Stoyanchev 提交于
      There is really no need for a result handler dedicated to a void
      return value and it's actually problematic to have it.
      
      Each result handler treats void as necessary. For an @ResponseBody
      method it means an empty body. For view resolution it means no specific
      value was returned and we should procede with selecting a default view
      name. Having a dedicated void result handler can interfere with this
      especially since view resolution needs to be last in order.
      
      At the same time there are cases when no result handling is needed
      and the response is fully handled within the HandlerAdapter. This is
      the case with WebHandler and the SimpleHandlerAdapter. For that case
      we simply return mono.then(aVoid -> Mono.empty()) which effectively
      returns an empty Mono and no result handling follows. The
      HandlerAdapter already says you can return no values at all if the
      response is fully handled.
      79bc227c
  11. 26 7月, 2016 1 次提交
  12. 23 7月, 2016 3 次提交
  13. 21 7月, 2016 1 次提交
  14. 20 7月, 2016 3 次提交
  15. 19 7月, 2016 2 次提交
  16. 16 7月, 2016 1 次提交
  17. 15 7月, 2016 3 次提交
  18. 08 7月, 2016 3 次提交
    • B
      Update after `reactor.core.converter.Converters` changes · b5bce1f0
      Brian Clozel 提交于
      Reactor's `DependencyUtils` has been renamed to `Converters` and
      all the `from` converter methods have been disambiguated to
      `fromPublisher`, `toPublisher`.
      b5bce1f0
    • R
      Comprensive support for empty request body · 7534092e
      Rossen Stoyanchev 提交于
      This commit adds support for handling an empty request body with both
      HttpEntity where the body is not required and with @RequestBody where
      the body is required depending on the annotation's required flag.
      
      If the body is an explicit type (e.g. String, HttpEntity<String>) and
      the body is required an exception is raised before the method is even
      invoked or otherwise the body is passed in as null.
      
      If the body is declared as an async type (e.g. Mono<String>,
      HttpEntity<Mono<String>>) and is required, the error will flow through
      the async type. If not required, the async type will be passed with no
      values (i.e. empty).
      
      A notable exception is rx.Single which can only have one value or one
      error and cannot be empty. As a result currently the use of rx.Single
      to represent the request body in any form effectively implies the body
      is required.
      7534092e
    • R
      Support HttpEntity method arguments · 1e1e2f8b
      Rossen Stoyanchev 提交于
      The RequestBodyArgumentResolver has been refactored to have a shared
      base class and tests with the new HttpEntityMethodArgumentResolver.
      
      An HttpEntity argument is not expected to have an async wrapper because
      the request headers are available immediately. The body however can be
      asynchronous, e.g. HttpEntity<Flux<String>>.
      1e1e2f8b
  19. 07 7月, 2016 2 次提交
  20. 04 7月, 2016 2 次提交
    • S
      Remove unused imports · f254680f
      Sebastien Deleuze 提交于
      f254680f
    • R
      Provide rich type information to ConversionService · 8c765814
      Rossen Stoyanchev 提交于
      When using the ConversionService to check and bridge to and from
      reactive types we now generallly provide the full type information
      available from method signatures. However that full type information
      is not always necessary such as when we perform additional checks on
      the generics of the reactive type (e.g. Mono<ResponseEntity>).
      
      This allows us to switch to use DefaultFormattingConversionService
      instead of GenericConversionService while also ensuring that the
      CollectionToObjectConverter doesn't think it can convert List<?> to
      any reactive type.
      
      The ObjectToObjectConverter can also interfere because it is smart
      enough to find the "from(Publisher<?>)" method on Flux and Mono.
      To make up for that on the response side we now check if a type
      is assignable to Publisher first in which case it is a simple cast.
      
      In turn that means we don't need a PublisherToFluxConverter which can
      be problematic in its own right because it can convert from Mono to
      Flux which technically doesn't lose data but switches stream semantics.
      
      Issue: #124, #128
      8c765814