Commit Graph

374 Commits

Author SHA1 Message Date
Rossen Stoyanchev
f0c8c4e7a4 Add request path based default view name support 2016-05-26 18:08:18 -04:00
Rossen Stoyanchev
793638e610 Rename ViewResolverResultHandler to ViewResolution~ 2016-05-26 17:48:35 -04:00
Rossen Stoyanchev
8b99c51969 Fix compiler warnings 2016-05-26 17:37:39 -04:00
Rossen Stoyanchev
eb9fe235fe Properly handle Mono.empty() for view resolution
This commit ensures correct handling for Mono.empty() return value
where the declared return type is Mono<String> or Mono<View>.
2016-05-26 17:34:52 -04:00
Rossen Stoyanchev
91a5759cf5 Polish result handlers default order 2016-05-26 16:17:56 -04:00
Rossen Stoyanchev
bc782902d7 Remove java.util.Optional from View contract 2016-05-26 16:00:08 -04:00
Rossen Stoyanchev
4d04bd5690 Consolidate view resolution under result.view
While View and ViewResolver play the same role as in spring-webmvc they
are now abstracted behind the HandlerResultHandler abstraction so that
top-level contracts don't reference them and the DispatcherHandler is
also unaware of their existence.

Furthermore view resolution and response body handling which are now at
the same level of abstraction (each is a HandlerResultHandler) will
also share code for content negotiation, so it makes sense for them to
be side by side.

This commit moves the reactive.view package to reactive.result.view
with the View and ViewResolver contracts (previously in the top-level
reactive package) also moving there.
2016-05-26 15:55:22 -04:00
Rossen Stoyanchev
318b15c321 Polish 2016-05-26 13:39:16 -04:00
Rossen Stoyanchev
2263954ad7 Respect produces condition in @ResponseBody algorithm 2016-05-26 13:34:08 -04:00
Rossen Stoyanchev
a017e2848a Rename ContentTypeResolver to RequestedContentTypeResolver 2016-05-26 11:05:48 -04:00
Rossen Stoyanchev
37404d081e Use ContentTypeResolver for content negotiation 2016-05-26 10:52:19 -04:00
Rossen Stoyanchev
2292e46b04 Update empty return value ResponseBody handling
When a null is returned from an @ResponseBody method, rather than
returning Mono.empty() immediately, convert it to Mono.empty() and
apply the same processing.

Currently that doesn't make a practical difference but it's more
accurate to do it this way. Eventually it may mean the possibility
to turn empty values into something through an extension point
as we do with ResponseBodyAdvice in Spring MVC today.
2016-05-25 17:35:58 -04:00
Rossen Stoyanchev
91d063899b Polish ResponseBody result handling 2016-05-25 17:34:15 -04:00
Rossen Stoyanchev
da3b21b020 Fix typo in build script 2016-05-24 15:41:51 -04:00
Rossen Stoyanchev
662e093fbb Temporarily fix RxJava at 1.1.1 to avoid hanging tests
Issue #103
2016-05-24 15:32:18 -04:00
Sebastien Deleuze
5cbc29e61e Upgrade to Tomcat 8.5.2 2016-05-17 13:24:36 +02:00
Stephane Maldini
a108268241 fix emit 2016-05-12 11:24:09 +01:00
Stephane Maldini
efa5b876fe fix emit 2016-05-12 09:36:28 +01:00
Stephane Maldini
f0d28f4b09 fixme : force retain() on incoming bytebuf content 2016-05-06 23:52:23 +01:00
Rossen Stoyanchev
59217243ee Add viewNames for UrlBasedViewResolver 2016-05-05 21:16:21 -04:00
Rossen Stoyanchev
aadbf1d8a6 Order ViewResolver's 2016-05-05 20:53:12 -04:00
Rossen Stoyanchev
4d9126a474 Add support for more annotated method arguments
- @PathVariable
 - @RequestHeader
 - @RequestParam
 - @CookieValue
 - @Value
 - @RequestAttribute
 - @SessionAttribute
2016-05-03 23:41:52 -04:00
Stephane Maldini
4e8c21e85a Sync Reactor SignalEmitter 2016-05-04 01:37:11 +01:00
Stephane Maldini
04f47da15e Synchronize Reactor Flux#create / Flux#generate changes 2016-05-03 23:06:07 +01:00
Arjen Poutsma
b71f143dfd Polishing 2016-05-03 16:33:56 +02:00
Stephane Maldini
b2d9e7c28d Split FluxProcessor factories into individual Processor, remove confusing factories 2016-05-02 22:56:18 +01:00
Stephane Maldini
eb21f3ab0a remove lift() 2016-04-28 22:38:26 +01:00
Arjen Poutsma
cc8b2109a9 Removed DataBufferUtils.toInputStream
Replaced all usages of toInputStream with non-blocking alternatives.
2016-04-28 16:12:35 +02:00
Arjen Poutsma
8aa7b42cbf Resolved DataBuffer leaks in codec package 2016-04-28 15:21:12 +02:00
Stephane Maldini
6fbaa7dbb4 compile time issue 2016-04-27 22:08:51 +01:00
Stephane Maldini
09fdc8a384 update consume to subscribe
update after to then (WIP flux)
2016-04-27 21:06:45 +01:00
Arjen Poutsma
72b66c9715 Introduction of PooledDataBuffer
This commit introduces a pooled data buffer as a subtype of DataBuffer,
as well as various utility methods related to reference counting.

Additionally, Crelease calls have been introduced throughout the
codebase to properly dispose of pooled databuffers.
2016-04-26 15:08:52 +02:00
Arjen Poutsma
92e1bff768 Merge pull request #84 from mp911de/charsetdecoder-in-stringdecoder
Use CharsetDecoder to decode a DataBuffer into a String.
2016-04-25 14:51:48 +02:00
Arjen Poutsma
ad0a4e0cf8 Introduce AbstractSingleValueEncoder
This commit introduces the AbstractSingleValueEncoder, an abstract base
class for encoders that only handle a single value.
2016-04-22 13:06:00 +02:00
Arjen Poutsma
9ed4bff4a9 Fixed DataBufferUtils.takeUntilByteCount 2016-04-22 13:01:18 +02:00
Arjen Poutsma
52c9b3b235 Introduce ResourceEncoder and ResourceDecoder
This commit introduces the ResourceEncoder and ResourceDecoder, and uses
these in ResourceHttpMessageConverter as a non-zero-copy fallback
method.
2016-04-22 09:54:51 +02:00
Rossen Stoyanchev
df7c8e550d Updates to WebHandler support
Rename two classes each adapting to WebHandler to avoid confusing them:
1. HttpWebHandlerAdapter adapts from the low level HttpHandler to any
WebHandler (e.g. DispatcherHandler).
2. SimpleHandlerAdapter adapts the plain WebHandler for use within the
DispatcherHandler.

This commit also fixes an issue in WebHttpHandlerBuilder to ensure that
WebExceptionHandler's are inserted before and not after WebFilter's.
2016-04-21 20:35:47 -04:00
Rossen Stoyanchev
a23f792052 Add SimpleUrlHandlerMapping
This commit replaces the temporary SimpleUrlHandlerMapping with
a full-featured one.
2016-04-21 17:04:43 -04:00
Arjen Poutsma
53f8b84bcc Polishing 2016-04-21 12:46:57 +02:00
Arjen Poutsma
df3cf69a96 Polishing 2016-04-21 12:23:44 +02:00
Rossen Stoyanchev
dd607d3e53 BadRequestStatusException -> ServerWebInputException
The renaming makes it clear this exception is for use where 400 error
applies within a Spring web application where the error may be
associated with a MethodParameter, a BindingResult, and so on.

There is no need for BadRequestStatusException which can be expressed
with ResponseStatusException(HttpStatus.BAD_REQUEST, "reason").
2016-04-20 13:39:42 -04:00
Arjen Poutsma
54eeb2cdb1 Merge pull request #97 from poutsma/zero_copy_response
@ResponseBody Resource support
2016-04-20 16:28:08 +02:00
Arjen Poutsma
804f69c8b6 Wrapping up zero-copy support
This commit wraps up the previous commits:

 - It uses HttpMessageConverter in the web.reactive.server package instead of Encoder/Decoder.
 - It introduces tests for the Resource @ResponseBodies.
2016-04-20 16:27:11 +02:00
Arjen Poutsma
3c486c02ab Reactive HttpMessageConverter
This commit introduces a reactive version of the HttpMessageConverter.
During the implementation of zero-copy support, it became apparent that
it was ueful to have a common abstraction between client and server that
operated on HttpMessages rather than DataBuffers.

Two HttpMessageConverter implementations are provided:
 - The CodecHttpMessageConverter, based on Encoder/Decoder.
 - The ResourceHttpMessageConverter, using zero-copy if available.
2016-04-20 16:27:11 +02:00
Arjen Poutsma
451e296a78 Zero-copy support
This commit introduces support for zero-copy file transfers in the HTTP
response, through the ZeroCopyHttpOutputMessage subinterface of
ReactiveHttpOutputMessage.
2016-04-20 16:27:04 +02:00
Arjen Poutsma
7b7f833004 Various MimeType and MediaType improvements 2016-04-20 13:34:30 +02:00
Arjen Poutsma
d626b5e833 Various DataBuffer improvements
This commit introduces two DataBuffer improvements:

 - The capability to read a Flux<DataBuffer> from an input stream or
   channel.

 - The capability to limit a Publisher<DataBuffer> to publish up until a
   given maximum byte count.
2016-04-20 13:30:40 +02:00
Rossen Stoyanchev
a173c78d98 Add getAttribute to WebSession and ServerWebExchange 2016-04-19 17:34:08 -04:00
Rossen Stoyanchev
d041b73c10 Polish 2016-04-19 16:43:50 -04:00
Rossen Stoyanchev
8ca5b830b1 Remove dependency on WebUtils 2016-04-19 16:41:32 -04:00