Commit Graph

13811 Commits

Author SHA1 Message Date
Rossen Stoyanchev c66dd01724 Equal MockServerHttpResponse in spring-test and -web 2016-12-14 05:54:53 -05:00
Sebastien Deleuze 4519c236d6 Restore reactor-netty test in FlushingIntegrationTests 2016-12-14 11:05:18 +01:00
Sebastien Deleuze 1829adecb7 Disable temporarily reactor-netty in FlushingIntegrationTests 2016-12-14 09:34:19 +01:00
Sebastien Deleuze b9892cc5d4 Add missing overrides to MockServerHttpResponse 2016-12-14 03:13:44 +01:00
Rossen Stoyanchev 3df902c6cc Add ServerHttpRequest builder
Similar pattern as for ServerWebExchange with a default mutate method
on ServerHttpRequest returning a Builder and eventually creating an
immutable wrapper.

HttpHandlerAdapterSupport uses the builder to set the contextPath.
2016-12-13 17:59:51 -05:00
Rossen Stoyanchev f693e32973 Add ServerHttpResponseDecorator
For completeness and consistency with the existing
ServerHttpRequestDecorator and the ServerWebExchangeDecorator.
2016-12-13 17:59:51 -05:00
Rossen Stoyanchev d421112af3 Polish ServerWebExchange builder and ServerHttpResponse
Remove duplicated ServerHttpResponse#setComplete also declard in the
parent ReactiveHttpOutputMessage interface.

Also rename:
ServerWebExchange.MutativeBuilder --> ServerWebExchange.Builder
2016-12-13 17:59:51 -05:00
Rossen Stoyanchev 7193686bb0 Support encodeUrl mechanism via ServerHttpResponse
Issue: SPR-14529
2016-12-13 17:59:51 -05:00
Rossen Stoyanchev 2191d80a31 Allow athentication at the STOMP level
This commit makes it possible for a ChannelInterceptor to override the
user header in a Spring Message that contains a STOMP CONNECT frame.

After the message is sent, the updated user header is observed and
saved to be associated with session thereafter.

Issue: SPR-14690
2016-12-13 17:59:51 -05:00
Brian Clozel d4411f4cc6 Update AbstractClientHttpRequest with server changes
This commit updates `AbstractClientHttpRequest` to make it more similar
to its server counterpart.
2016-12-13 22:58:01 +01:00
Rossen Stoyanchev a8d834b797 Merge pull request #1263 2016-12-13 16:01:24 -05:00
Rossen Stoyanchev 128a1f8eed Polish MockRestRequestMatchers query param support
Issue: SPR-14995
2016-12-13 16:00:46 -05:00
schjan79 ba826f1026 MockRestRequestMatchers can match query params
Issue: SPR-14995
2016-12-13 16:00:46 -05:00
Brian Clozel ba47d06cbb Update integration tests for reactor-netty
Now that reactor/reactor-netty#12 is fixed, we can restore the
previously ignored integration tests.
New tests are hanging, so this commit is converting the `StepVerifier`
`verify()` calls to using actual timeouts.

Issue: SPR-14975
2016-12-13 21:34:13 +01:00
Stephane Maldini 2802926c1d update STOMP support to reactor-netty 0.6 2016-12-13 17:31:09 +00:00
Stephane Maldini 70bab23609 update STOMP support to reactor-netty 0.6 2016-12-13 17:29:43 +00:00
Stephane Maldini 6922a1c534 Sync with latest reactor netty changes 2016-12-13 17:22:40 +00:00
Juergen Hoeller 39d2769bd0 Autodetect Kotlin nullability for optional injection points (analogous to java.util.Optional)
Built-in support in MethodParameter and DependencyDescriptor supersedes our separate KotlinUtils helper.

Issue: SPR-14951
2016-12-13 17:38:58 +01:00
Juergen Hoeller 361ab6b621 Merge pull request #1266 from kazuki43zoo/SPR-15009
Support lazy initialization of BindingResult when customize a MessageCodesResolver
2016-12-13 16:55:59 +01:00
Kazuki Shimizu 9f229283fb Support lazy initialization of BindingResult when customize a MessageCodesResolver
Issue: SPR-15009
2016-12-14 00:50:25 +09:00
Juergen Hoeller 5169c51a6c Polishing 2016-12-13 13:02:23 +01:00
Juergen Hoeller eeb7ae537f @RequestBody supports java.util.Optional
Issue: SPR-15007
2016-12-13 13:00:03 +01:00
Brian Clozel 52f664139f Improve VersionResourceResolve javadoc
The `pathPatterns` args are relative to the patterns configured for the
resource handler.

Issue: SPR-14817
2016-12-13 10:43:27 +01:00
Rossen Stoyanchev 885e76bdd0 Synchronized lazy start in JettyRequestUpgradeStrategy
Issue: SPR-14527
2016-12-12 21:10:59 -05:00
Rossen Stoyanchev 75422787b6 Merge Tomcat, Jetty, Undertow WebSocket support 2016-12-12 17:57:30 -05:00
Rossen Stoyanchev d6895aa098 Consistently extend WebSocketHandlerAdapterSupport
The WebSocketHandler adapters for all runtimes now extend
WebSocketHandlerAdapterSupport, which now also exposes
a shared DataBufferFactory property initialized from the response.

Issue: SPR-14527
2016-12-12 17:56:48 -05:00
Rossen Stoyanchev 5829e1c141 Polish method and field declaration order 2016-12-12 17:56:48 -05:00
Rossen Stoyanchev f32a41933e Polish 2016-12-12 17:56:48 -05:00
Rossen Stoyanchev db5bc4a24e Minor refactoring of suspend/resumeReceiving
suspend/resumeReceiving in the AbstractListenerWebSocketSession are
now abstract methods. In Tomcat/Jetty these methods are no-op
implementations that are then coupled with a buffering strategy via
Flux#onBackpressureBuffer. In Undertow they rely on flow control for
receiving WebSocket messages.

Issue: SPR-14527
2016-12-12 17:56:48 -05:00
Violeta Georgieva 08edec006b Refactor AbstractListenerWebSocketSession
- Added suspended flag to indicate whether the ReceivePublisher
is able to process the incoming messages.
- Use buffer strategy for the incoming messages.

Issue: SPR-14527
2016-12-12 17:56:48 -05:00
Violeta Georgieva 9d03b77cdc Rename "ResponseBody" flush processor + use generics
Issue: SPR-14527
2016-12-12 17:56:48 -05:00
Rossen Stoyanchev d1411d9fc2 Simple refactorings in AbstractListenerWebSocketSessionSupport
Dropped "Support" from the name since it not only provides support
methods but actually implements WebSocketSession.

Renamed inner classes:
WebSocketMessagePublisher -> WebSocketReceivePublisher
WebSocketMessageProcessor -> WebSocketSendProcessor

Add protected getter for sendProcessor.

Reduce scoping:
WebSocketReceivePublisher -> private
WebSocketSendProcessor -> protected
WebSocketSendProcessor#setReady -> public (class is still protected)

A few more method name alignments and Javadoc updates.

Issue: SPR-14527
2016-12-12 17:56:48 -05:00
Rossen Stoyanchev fe7ee5ff33 Rename "Request/ResponseBody" publisher/processor
AbstractRequestBodyPublisher and AbstractResponseBodyProcessor are now
used for WebSocket messages too and have been renamed more generally to
AbstractListenerReadPublisher and AbstractListenerWriteProcessor.

Issue: SPR-14527
2016-12-12 17:56:48 -05:00
Violeta Georgieva a2053a516e Initial reactive, WebSocket Jetty support
Issue: SPR-14527
2016-12-12 17:56:47 -05:00
Violeta Georgieva 80040ef43b Initial reactive, WebSocket Undertow support
Issue: SPR-14527
2016-12-12 17:56:47 -05:00
Violeta Georgieva 46b39f4372 Initial reactive, WebSocket Tomcat support
Issue: SPR-14527
2016-12-12 17:56:47 -05:00
Violeta Georgieva 41ece612cf Generic AbstractRequest/ResponseBodyProcessor
In preparation for use with WebSockets.

Issue: SPR-14527
2016-12-12 17:56:47 -05:00
Juergen Hoeller e49813f2c4 Polishing 2016-12-12 22:49:40 +01:00
Juergen Hoeller aef1460a64 TypeDescriptor properly narrows ResolvableType for non-typed collection elements
Issue: SPR-14971
2016-12-12 22:28:48 +01:00
Juergen Hoeller 8b5ee4ef91 AutowiredAnnotationBeanPostProcessor tolerates annotated no-arg constructors
Issue: SPR-15005
2016-12-12 22:26:24 +01:00
Juergen Hoeller b825528d01 SQLErrorCodesFactory provides unregisterDatabase method
This commit also migrates from a WeakHashMap to a ConcurrentReferenceHashMap, allowing for concurrent access to existing cache entries.

Issue: SPR-15006
2016-12-12 15:26:46 +01:00
Juergen Hoeller 04ed5910ba Upgrade Gradle Wrapper version to Gradle 3.2.1
Issue: SPR-14906
2016-12-12 15:26:12 +01:00
Brian Clozel 933f1501e8 Do not include URL hash in resource paths
When getting the lookup path of a resource, both query params and hashes
should be removed from the request path.

This commit fixes the public path resolution for paths like
`/resources/main.svg#icon-hamburgermenu`.

Issue: SPR-14928
2016-12-12 15:14:50 +01:00
Juergen Hoeller 66e6b35e9f Reliable content length check in ResourceHandlerFunctionTests 2016-12-12 09:57:57 +01:00
Juergen Hoeller f7ea469897 Latest dependency updates (OkHttp 3.5, Tomcat 8.5.9, Undertow 1.4.7, XNIO 3.4.2) 2016-12-12 09:57:10 +01:00
Brian Clozel 17089d607f Allow RedirectAttributes on ExceptionHandlers
Prior to this commit, `@ExceptionHandler` methods could not be injected
with `RedirectAttributes` arguments. This would make it impossible to
handle an error by redirecting to another view and add flashmap
attributes, to be included in the model when the next view is called.

Here is an example:

```
@ExceptionHandler(MyException.class)
public String handleException(MyException ex, RedirectAttributes
    redirectAttributes) {

  redirectAttributes.addFlashAttribute("errorMessage",
      "This is an error message");
  return "redirect:/";
}
```

This commit adds a new `RedirectAttributesMethodArgumentResolver`
instance in the list of pre-configured `HandlerMethodArgumentResolver`
in `ExceptionHandlerExceptionResolver`.

Issue: SPR-14651
2016-12-09 23:41:22 +01:00
Juergen Hoeller 547b9638dc Collection injection may refer back to factory methods on same bean again
Issue: SPR-14996
2016-12-09 23:09:10 +01:00
Juergen Hoeller aa29495d1d CommonsMultipartFile.getOriginalFilename() can be configured to preserve header-specified filename as-is
Issue: SPR-14613
2016-12-09 23:05:51 +01:00
Juergen Hoeller 39739b3157 Upgrade to Hibernate Validator 5.4 beta 1
Issue: SPR-14998
2016-12-09 15:22:24 +01:00
Juergen Hoeller 52799c0e3d Revised Jetty 9.3 vs 9.4 differentiation
Issue: SPR-14940
2016-12-09 15:21:31 +01:00