1. 11 4月, 2017 4 次提交
  2. 10 4月, 2017 1 次提交
    • S
      Make CodecException handling consistent · d098a4b9
      Sebastien Deleuze 提交于
      This commit makes CodecException handling consistent between functional
      and annotation-based APIs. It now returns by default 4xx status code
      for decoding error and 5xx for encoding error + print the error reason
      in logs without the full stack trace in both variants.
      
      Issue: SPR-15355
      d098a4b9
  3. 08 4月, 2017 4 次提交
  4. 07 4月, 2017 5 次提交
  5. 05 4月, 2017 1 次提交
    • A
      Server HttpMessage[Reader|Writer] in WebFlux fn · 99474376
      Arjen Poutsma 提交于
      This commit introduces support for the server-side methods on
      HttpMessageReader and HttpMessageWriter. It does so by introducing an
      Optional ServerHttpRequest in BodyInserter.Context, and an Optional
      ServerHttpResponse in BodyExtractor.Context. On the client-side, these
      optionals return Optional.empty(); on the server-side, they return the
      respective server-side messages.
      
      Issue: SPR-15370
      99474376
  6. 02 4月, 2017 1 次提交
  7. 31 3月, 2017 2 次提交
    • S
      Resolve async model attributes in AbstractView · 73b44828
      Sebastien Deleuze 提交于
      This change allows the functional WebFlux API to support natively
      reactive types and also makes it possible for View implementations to
      disable async attributes resolution if they want for example take
      advantage of stream rendering.
      
      It also makes AbstractView#getModelAttributes() asynchronous.
      
      Issue: SPR-15368
      73b44828
    • R
      Add ResponseSpec to WebClient · 840d7abb
      Rossen Stoyanchev 提交于
      Replace the overloaded "retrieve" methods with a single retrieve() +
      ResponseSpec exposing shortcut methods (bodyToMono, bodyToFlux)
      mirroring the ClientResponse shortcuts it delegates to.
      
      Unlike exchange() however with retrieve() there is no access to other
      parts of ClientResponse so ResponseSpec exposes additional shortcuts
      for obtain ResponseEntity<T> or ResponseEntity<List<T>>.
      
      Issue: SPR-15294
      840d7abb
  8. 30 3月, 2017 4 次提交
    • A
      Simplify access to response body in WebClient · e6b4edc7
      Arjen Poutsma 提交于
      This commit makes a change to WebClient in oder to facilitate getting
      the response body as a `Mono<Object>` or `Flux<Object>` without having
      to deal with `ClientResponse`.
      
      Specifically, this commit:
      
       - Adds `RequestHeaderSpec.retrieve` methods, next to `exchange`, that
       return the response body (and not a `ClientResponse`). Two convenience
       methods return the response body as `Mono` or `Flux`.
       - Adds ClientResponse.toRequestEntity to convert the ClientResponse
       into a RequestEntity.
      
      Issue: SPR-15294
      e6b4edc7
    • R
      ServerCodecConfigurer as input in HandlerAdapter · cd8c365a
      Rossen Stoyanchev 提交于
      The ServerCodecConfigurer is now passed all the way into the
      RequestMappingHandlerAdapter which automatically enables the same
      defaults even without the Java config and provides extra flexibility
      in passing message codec configuration for the future.
      cd8c365a
    • R
      Add ArgumentResolverConfigurer · a8162c03
      Rossen Stoyanchev 提交于
      Replace the List<HandlerMethodArgumentResolver> with a dedicated
      configurer that currently has one method accepting custom resolver
      registrations.
      a8162c03
    • A
      Request body improvements in WebClient, WebTestClient · 118f33ae
      Arjen Poutsma 提交于
      This commit makes changes to WebClient and WebTestClient in oder to
      limit setting the body according to HTTP method and also to facilitate
      providing the request body as Object.
      
      Specifically, this commit:
      
       - Moves methods that operate on the request body to a RequestBodySpec
       in both WebClient and WebTestClient, and rename them to `body`.
       These methods now just *set* the body, without performing
       an exchange (which now requires an explicit exchange call).
       - Parameterizes UriSpec in both WebClient and WebTestClient, so that
       it returns either a RequestHeadersSpec or a RequestBodySpec.
      
      Issue: SPR-15394
      118f33ae
  9. 29 3月, 2017 1 次提交
  10. 28 3月, 2017 3 次提交
  11. 25 3月, 2017 2 次提交
  12. 24 3月, 2017 5 次提交
    • B
      Resolve ResourceUrlProvider from current request · 2baceac5
      Brian Clozel 提交于
      This commit changes `ResourceTransformerSupport` to look for the
      `ResourceUrlProvider` in the current request if none is configured on
      the resource transformer itself.
      
      Issue: SPR-15369
      2baceac5
    • B
      VersionResourceResolver should delegate to the chain · fdd50315
      Brian Clozel 提交于
      Prior to this commit, the `VersionResourceResolver` implementations of
      `resolveUrlPathInternal` would delegate to the resolver chain but would
      never use the give result if the current request didn't match a
      configured version strategy pattern.
      
      This is a problem if the resolver supposed to resolve the resource path
      is configured after a `VersionResourceResolver` in the resolver chain;
      this means that other resolver never gets to participate in the result
      of the chain.
      
      Issue: SPR-15372
      fdd50315
    • J
      Support for populating model attributes through data class constructors · 65ba865d
      Juergen Hoeller 提交于
      Includes a new overloaded ModelAndView constructor with an HttpStatus argument, as well as a HandlerMethodArgumentResolverSupport refactoring (revised checkParameterType signature, actually implementing the HandlerMethodArgumentResolver interface).
      
      Issue: SPR-15199
      65ba865d
    • R
      String decoding for text only vs any MIME type · 0662dbf0
      Rossen Stoyanchev 提交于
      Follow-up to:
      https://github.com/spring-projects/spring-framework/commit/3d68c496f15c80a75711480a569cda1f7c64dc91
      
      StringDecoder can be created in text-only vs "*/*" mode which in turn
      allows a more intuitive order of client side decoders, e.g. SSE does
      not have to be ahead of StringDecoder.
      
      The commit also explicitly disables String from the supported types in
      Jackson2Decoder leaving it to the StringDecoder in "*/*" mode which
      comes after. This does not change the current arrangement since the
      the StringDecoder ahead having "*/*" picks up JSON content just the
      same.
      
      From a broader perspective this change allows any decoder to deal with
      String if it wants to after examining the content type be it the SSE
      or another, custom decoder. For Jackson there is very little value in
      decoding to String which works only if the output contains a single
      JSON string but will fail to parse anything else (JSON object/array)
      while StringDecoder in "*/*" mode will not fail.
      
      Issue: SPR-15374
      0662dbf0
    • A
      Introduce 'useRegisteredExtensionsOnly' property in classes using MediaTypeFactory · a287e679
      Arjen Poutsma 提交于
      This commit introduces a `useRegisteredExtensionsOnly` property that
      indicates whether classes that use the `MediaTypeFactory` for supplying
      default media types can do so.
      
       - In classes that were introduced in Spring 5.0, the
       `useRegisteredExtensionsOnly` property takes the place of the
       `useJaf` property that was removed in 0aaa6528
       - In classes that existed before Spring 5.0, the
       `useRegisteredExtensionsOnly` property is added in addition to the
       deprecated `useJaf`, the latter delegating to the former, but with
       flipped behavior.
      
      Issue: SPR-14908
      a287e679
  13. 23 3月, 2017 2 次提交
    • A
      Change MediaTypeFactory to return Optional · fd1db57e
      Arjen Poutsma 提交于
      This commit changes the `MediaTypeFactory` to return
      `Optional<MediaType>` (instead of a plain `MediaType`) for the
      `getMediaType` methods.
      
      Issue: SPR-14908
      fd1db57e
    • R
      String encoding for any MIME type · 3d68c496
      Rossen Stoyanchev 提交于
      CharSequenceEncoder now supports all MIME types, however since encoding
      Flux<String> can overlap with other encoders (e.g. SSE) there are now
      two ways to create a CharSequenceEncoder -- with support for text/plain
      only or with support for any MIME type.
      
      In WebFlux configuration we insert one CharSequenceEncoder for
      text/plain (as we have so far) and a second instance with support for
      any MIME type at the very end.
      
      Issue: SPR-15374
      3d68c496
  14. 22 3月, 2017 5 次提交
    • A
      Change MethodNotAllowedException to use HttpMethod · 290e9bea
      Arjen Poutsma 提交于
      Changed the MethodNotAllowedException to use HttpMethod, instead of
      Strings.
      290e9bea
    • A
      Allow for subclassing ServerResponse · 722e2306
      Arjen Poutsma 提交于
      This commit changes `ServerResponse` and subtypes to use properties
      instead of fields during response rendering. This allows for overriding
      these methods in a response subclass.
      722e2306
    • A
      Add RenderingResponse.from · 24f7f26f
      Arjen Poutsma 提交于
      This commit introduces RenderingResponse.from(RenderingResponse),
      allowing for easier response filtering.
      24f7f26f
    • A
      Fix ofResponseProcessor signature · d17b99fe
      Arjen Poutsma 提交于
      This commit changes the `HandlerFilterFunction.ofResponseProcessor`
      method signature to return `Mono<ServerResponse>`, to better cooperate
      with response builders (which all return a `Mono`).
      d17b99fe
    • R
      Polish + minor refactoring of SSE reader and writer · a999f40d
      Rossen Stoyanchev 提交于
      Instead of accepting List<Encoder|Decoder> and then look for the first
      to support JSON, always expect a single JSON [Encoder|Decoder] and use
      that unconditionally.
      
      When writing use the nested ResolvableType instead of the Class of the
      actual value which should better support generics.
      
      Remove the SSE hint and pass "text/event-stream" as the media type
      instead to serve as a hint. We are expecting a JSON encoder and using
      it unconditionally in any case so this should be good enough.
      a999f40d