Commit Graph

13686 Commits

Author SHA1 Message Date
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
Juergen Hoeller
953bc189e7 Stronger explanation of default rollback rules
Issue: SPR-14994
2016-12-09 15:05:20 +01:00
Juergen Hoeller
7714eeccf3 MimeType parsing properly handles quoted semicolons
Issue:  SPR-14986
2016-12-09 15:04:26 +01:00
Juergen Hoeller
a7ec6dc0af ImportRegistry properly tracks excluded superclasses
Issue: SPR-14972
2016-12-09 15:01:21 +01:00
Brian Clozel
e1b89c7f65 Upgrade to Jetty 9.4.0.v20161208
Issue: SPR-14940
2016-12-09 09:13:01 +01:00
Brian Clozel
8d828dd16f Update websocket support for Jetty 9.3+
Due to a few changes in `WebSocketServerFactory` and `Session` API, our
`JettyRequestUpgradeStrategy` and `JettyWebSocketSession` needed to
adapt. As of 9.3.15+ and 9.4.0+, some reflection is required to support
previous versions.

Spring 5.0 supports Jetty 9.3 and 9.4.

Issue: SPR-14940
2016-12-08 21:53:28 +01:00
Juergen Hoeller
cf6a5835cc Polishing 2016-12-08 18:39:30 +01:00
Juergen Hoeller
313c89dd5c Overloaded methods with java.time.Instant/Duration parameters
Issue: SPR-14875
2016-12-08 18:34:00 +01:00
Juergen Hoeller
278a6250e6 Explicit support for retrieving enum values
Issue: SPR-14990
2016-12-08 18:30:25 +01:00
Juergen Hoeller
ee30ce95fe HttpInvokerClientInterceptor propagates client-side Error as-is
Issue: SPR-14985
2016-12-08 18:29:41 +01:00
Juergen Hoeller
8ab977e7d1 Revised forClass argument names
Issue: SPR-14976
2016-12-08 18:28:03 +01:00
Juergen Hoeller
2f80b8485a JPA/Hibernate docs: transaction management, JTA setup
Issue: SPR-14957
2016-12-08 18:24:12 +01:00
Juergen Hoeller
05579fd1b9 SpEL docs: supported literals, null comparisons
Issue: SPR-14361
Issue: SPR-14987
2016-12-08 18:16:48 +01:00
Juergen Hoeller
6517c53768 Consistent use of "URI variables" terminology
Issue: SPR-14969
2016-12-08 18:11:21 +01:00
Rossen Stoyanchev
11ff03ed38 Merge pull request #1236 from dreis2211-stomp-header-encoding 2016-12-08 11:14:40 -05:00
Rossen Stoyanchev
b3fa1b40a0 Synchronized updates of STOMP header key cache
Issue: SPR-14901
2016-12-08 11:13:57 -05:00
Christoph Dreis
9b76dc2ab4 SPR-14901 Allow customization of STOMP message header encoding
Fixes SPR-14901
2016-12-08 11:13:56 -05:00
Sebastien Deleuze
2735cba4b3 Append "data:" after line breaks for SSE JSON data fields
Issue: SPR-14899
2016-12-08 11:19:46 +01:00
bedrin
8315a4033f Add consumes attribute to @GetMapping
Issue: SPR-14988
2016-12-07 17:45:43 -05:00
Rossen Stoyanchev
1b0e95d7d8 Support for RequestUpgradeStrategy + Lifecycle
Issue: SPR-15527
2016-12-07 17:03:56 -05:00
Sebastien Deleuze
24b3614063 Add a 8 Kb flush threshold to RxNettyServerHttpResponse
Issue: SPR-14991
2016-12-07 11:13:45 +01:00
Brian Clozel
856cb3b964 Revert "Upgrade to Jetty 9.4.0.RC3"
This reverts commit 472126c0b2.
2016-12-07 11:02:37 +01:00
Brian Clozel
472126c0b2 Upgrade to Jetty 9.4.0.RC3
Issue: SPR-14940
2016-12-07 10:23:53 +01:00
Brian Clozel
ec8391a7fb Fix Netty4ClientHttpRequestFactory POST/PUT requests
This commit ensures that POST/PUT requests sent by the Netty client have
a Content-Length header set.

Integration tests have been refactored to use mockwebserver instead of
Jetty and have been parameterized to run on all available supported
clients.

Issue: SPR-14860
2016-12-07 09:23:53 +01:00
Rossen Stoyanchev
2c2de82ffb Flush after each WebSocket message by default
Issue: SPR-14527
2016-12-06 17:08:30 -05:00
Rossen Stoyanchev
c097c0284a Reactor Netty WebSocket server-side support
Issue: SPR-14527
2016-12-06 17:08:30 -05:00