Commit Graph

13392 Commits

Author SHA1 Message Date
Stephane Nicoll
7565355deb Merge pull request #1205 from marschall:SPR-14810
* pr/1205:
  Fix NativeJdbcExtractors documentation
2016-10-15 11:57:34 +03:00
Philippe Marschall
f7c79295f3 Fix NativeJdbcExtractors documentation
The documentation mentions various NativeJdbcExtractors that no longer
exist. To be specific CommonsDbcpNativeJdbcExtractor and
XAPoolNativeJdbcExtractor no longer exist.

This commit includes the following changes:

 * remove CommonsDbcpNativeJdbcExtractor references from Asciidoctor
 * remove CommonsDbcpNativeJdbcExtractor references from Javadoc
 * remove XAPoolNativeJdbcExtractor references from Asciidoctor

Issue: SPR-14810
Closes gh-1205
2016-10-15 11:56:57 +03:00
Stephane Nicoll
33bf439a74 Merge pull request #1206 from marschall:SPR-14811
* pr/1206:
  Fix formatting
  Replace J2EE with Java EE
2016-10-15 11:55:30 +03:00
Stephane Nicoll
fc8bad36c9 Fix formatting
Closes gh-1206
2016-10-15 11:55:07 +03:00
Philippe Marschall
ae5b0c6fb5 Replace J2EE with Java EE
String with version 5 the name of Java Platform, Enterprise Edition
changed from J2EE to Java EE. However a lot of the documentation still
uses the term J2EE.

This commit includes the following changes:

 * replace J2EE with Java EE where appropriate

This is not a blind search and replace. The following occurrences
remain unchanged:

 * references to old J2EE releases, most notably 1.3 and 1.4.
 * references to "Expert One-On-One J2EE Design and Development"
 * references to "Core J2EE patterns"
 * XML namespaces
 * package names

Issue: SPR-14811
See gh-1206
2016-10-15 11:49:00 +03:00
Rossen Stoyanchev
8619ad9d9a Add tests to DelegatingWebReactiveConfigurationTests 2016-10-14 21:06:42 -04:00
Rossen Stoyanchev
351cfb8eef Merge pull request #1202 from bclozel/SPR-14754 2016-10-14 18:11:58 -04:00
Rossen Stoyanchev
c7fb851e5a Polish 2016-10-14 18:11:16 -04:00
Rossen Stoyanchev
44717af0e5 Update order of method in WebReactiveConfigurer 2016-10-14 18:02:00 -04:00
Rossen Stoyanchev
7f6eaef305 Improve WebReactiveConfigurerComposite 2016-10-14 17:55:40 -04:00
Brian Clozel
3533024ab8 Add EnableWebReactive + WebReactiveConfigurer
This commit improves the existing web reactive configuration
infrastructure with the following changes:

* renamed `WebReactiveConfiguration` to
`WebReactiveConfigurationSupport` and is is no longer a Configuration
class
* created the `WebReactiveConfigurer` interface; Configuration classes
implementing it will augment the web reactive configuration support
* created the `DelegatingWebReactiveConfiguration` and
`WebReactiveConfigurerComposite` to effectively tie those custom-defined
configurers to the main configuration support
* created the `@EnableWebReactive` to active that support in
configuration classes

Issue: SPR-14754
2016-10-14 17:23:37 -04:00
Rossen Stoyanchev
ea319345ed Merge pull request #1188 from soldierkam/fix-encoding-bb 2016-10-14 17:17:12 -04:00
Rossen Stoyanchev
6cb7d51ee5 Polish 2016-10-14 17:16:23 -04:00
soldierkam
e5158d47e0 EncoderHttpMessageWriter tries to send wildcard type in response header 2016-10-14 16:58:31 -04:00
Violeta Georgieva
ced6559941 Improve AbstractResponseBodyProcessor.onNext(..)
If the provided DataBuffer is empty then request the next DataBuffer.
2016-10-14 16:41:14 -04:00
Rossen Stoyanchev
fada5aed6e Check status in AbstractServerHttpResponse setComplete 2016-10-14 15:32:34 -04:00
Stephane Nicoll
6fb4352e5c Merge pull request #1204 from marschall:SPR-14809
* pr/1204:
  Remove OracleLobHandler from documentation
2016-10-14 18:00:58 +03:00
Philippe Marschall
eee742da7f Remove OracleLobHandler from documentation
Now that OracleLobHandler has finally been removed it should also be
removed from the documentation.

This commit includes the following changes:

 * remove OracleLobHandler references from Javadoc
 * remove OracleLobHandler references from Asciidoctor

Issue: SPR-14809
Closes gh-1204
2016-10-14 18:00:26 +03:00
Rossen Stoyanchev
960cc42060 Fix test failure in WebSessionIntegrationTests 2016-10-13 18:02:41 -04:00
Rossen Stoyanchev
d4446c79b6 Restore state field in AbstractServerHttpResponse
This commit fixes test failures introduced earlier in commit 9f8e84.
2016-10-13 17:10:51 -04:00
Rossen Stoyanchev
8eeda746e3 Merge pull request #1194 from violetagg/async-timeout 2016-10-13 16:33:22 -04:00
Rossen Stoyanchev
c1e5e3a87e Polish AsyncListener in ServletHttpHandlerAdapter 2016-10-13 16:31:53 -04:00
Violeta Georgieva
7e94377382 Handle async operation events
Problem:
The following exception is observed on an async timeout:
"java.lang.IllegalStateException: It is invalid to call
isReady() when the response has not been put into non-blocking mode"

Current Implementation:
The async operation events sent by the web container are not propagated
to the internal implementation. When timeout/error happens and if the
application does not complete the async operation, the web container
will complete it. At that point if the application tries to read/write,
the operation will fail with an exception (above) that there is not
async operation started.

Proposed Solution:
On async timeout or error, make calls to:
- AbstractRequestBodyPublisher.onError,
- AbstractResponseBodyProcessor.onError,
- AbstractResponseBodyFlushProcessor.onError
As a result of these calls the async operation will be completed and no
more invocations of read/write will be made.
2016-10-13 16:14:33 -04:00
Rossen Stoyanchev
9f8e8458c1 Polish AbstractServerHttpResponse
This commit simplifies the logic for applying beforeCommit actions
replacing the use of chained Mono.then calls with a single
Flux.concat.

Also renamed writeStatusCode, writeHeaders, and writeCookies to
applyStatusCode, applyHeaders, and applyCookies respectively to
better reflect we're simply setting them on the underlying response
(not necessarily written yet).
2016-10-13 16:04:30 -04:00
Brian Clozel
336b4d2fb8 Polish 2016-10-13 20:57:15 +02:00
Rossen Stoyanchev
e3ecf012f9 Add docs on error handling in REST scenarios 2016-10-13 13:56:40 -04:00
Rossen Stoyanchev
71201e1a43 Relax generic type detection for ResponseEntity
Before this change the getHttpEntityType method in
HttpEntityMethodProcessor raised an ISE if the generic type cannot be
detected. That made sense for resolving a controller method argument
where the target body type is crucial. However for a return value
the generic type should not be required since we either have an
actual body or no body at all in which case it doesn't even matter.

This change relaxes the checks and defaults to Object.class for the
ResponseEntity generic type on the return value side.

Issue: SPR-14799
2016-10-13 13:31:47 -04:00
Sam Brannen
a795fd4714 Add support for URI templates in redirectedUrl() & forwardedUrl()
Prior to this commit, the redirectedUrl() and forwardedUrl() methods in
MockMvcResultMatchers supported fully constructed URLs and URLs
containing Ant-style path patterns. However, URI templates were not
supported for these result matchers even though the request path can be
built using URL templates -- for example, via the get() and post()
methods in MockMvcRequestBuilders.

This commit addresses this shortcoming by allowing users to supply a
URL template instead of a fully constructed URL to redirectedUrl() and
forwardedUrl(). To populate the URL template, template variables may be
supplied to redirectedUrl() and forwardedUrl() as var-args.

Issue: SPR-14790
2016-10-13 17:02:00 +02:00
Sam Brannen
509796a4b5 Polish MockMvcResultMatchers[Tests] 2016-10-13 17:01:47 +02:00
Sam Brannen
8cf1933148 Only print request/response body if char enc is present in MVC Test
Commit e65a1a4372 introduced support in PrintingResultHandler for only
printing the request or response body in the Spring MVC Test framework
if the content type is known to be text-based (e.g., plain text, HTML,
XHTML, XML, JSON, etc.). For unknown content types the body is assumed
to be text-based and is therefore always printed. The latter behavior,
however, is undesirable since the content may in fact not be text-based.

This commit addresses this issue by making the printing of the request
or response body an opt-in feature. Specifically, if a character
encoding has been set, the request or response body will be printed by
the PrintingResultHandler. Note, however, that the character encoding
is set to ISO-8859-1 in MockHttpServletResponse by default.

In addition, MockHttpServletRequest's getContentAsString() method now
throws an IllegalStateException if the character encoding has not been
set.

Issue: SPR-14776
2016-10-13 16:55:14 +02:00
Juergen Hoeller
69116c2acc Documentation for InjectionPoint argument on @Bean method
Issue:  SPR-14797
2016-10-12 17:14:24 +02:00
Juergen Hoeller
a29188a191 Upgrade to Hibernate Validator 5.3 (as well as Log4J 2.7, Protobuf 3.1, Tomcat 8.5.6)
Issue: SPR-13965
2016-10-12 17:13:07 +02:00
Juergen Hoeller
eafaaa5cb8 Polishing 2016-10-12 17:11:04 +02:00
Juergen Hoeller
a32b52555a @Primary not marked as inherited anymore
Issue: SPR-14780
2016-10-12 17:10:29 +02:00
Juergen Hoeller
74b6a5b6d7 BindingResult does not hold on to ConversionService when serialized in session
Issue: SPR-8282
2016-10-12 17:08:55 +02:00
Juergen Hoeller
66722afda0 StompSubProtocolHandler does not insist on SimpMessageHeaderAccessor
Issue: SPR-14791
2016-10-12 17:08:05 +02:00
Rossen Stoyanchev
aff43c29fd BindingContext implements TypeConverter 2016-10-12 09:01:15 -04:00
Rossen Stoyanchev
bd69390c0f Fix failing test 2016-10-12 08:56:52 -04:00
Rossen Stoyanchev
8a043ae9aa Replace direct use of Validator and ConversionService
This commit replaces direct use of Validator and ConversionService in
the reactive @RequestMapping infrustructure in favor of using the
BindingContext.

Issue: SPR-14541
2016-10-11 20:53:52 -04:00
Rossen Stoyanchev
d87aa40efe Add BindingContext
This commit adds a BindingContext to be used in spring-web-reactive
@RequestMapping infrastructure (comparable to WebDataBinderFactory in
spring-web-mvc) for access to the default model, data binding,
validation, and type conversion purposes.

Issue: SPR-14541
2016-10-11 20:50:59 -04:00
Rossen Stoyanchev
cabb253269 Replace "mvc" in web rective config bean names 2016-10-11 20:20:40 -04:00
Rossen Stoyanchev
1de73b9b4f Polish 2016-10-11 20:20:40 -04:00
Rossen Stoyanchev
b28b3e8877 Add WebExchangeDataBinder
Issue: SPR-14541
2016-10-11 20:20:40 -04:00
Sam Brannen
580b8b92f8 Fix punctuation in Javadoc 2016-10-11 20:40:12 +02:00
Sam Brannen
e65a1a4372 Print only printable request/response body in MVC Test
Prior to this commit, PrintingResultHandler always printed the request
or response body regardless of its content type. For binary content,
however, the output was unreadable and therefore useless.

This commit addresses this issue by only printing the request or
response body if it is "printable" (i.e., if its content type is known
to be text-based such as plain text, HTML, XHTML, XML, JSON, etc.). If
the content type is unknown (e.g., unspecified for the HTTP request in
the test), it is assumed that the body is printable.

Issue: SPR-14776
2016-10-11 20:19:26 +02:00
Brian Clozel
7ae729480e Resolve absolute resource links in ResourceTransformers
This commit adapts the fix for SPR-14597 commited to spring-webmvc to
the spring-web-reactive module.

Issue: SPR-14597
2016-10-11 17:45:34 +02:00
Brian Clozel
679b661e19 Resolve absolute resource links in ResourceTransformers
Prior to this commit, `ResourceTransformer` implementations would
resolve internal links to other resources: both relative and absolute
request paths.
For relative request paths, those transformers would call
`ResourceTransformerSupport.resolveUrlPath` with the resource path,
as provided in the original file. This can cause problems when a
`CachingResourceResolver` is configured in the resolver chain, because
this resolver is caching resources, deriving the cache key from the
given resource path — this can cause collisions for cases like this:

    resources/
    |--foo/
    |  |--foo.css (imports style.css)
    |  |--style.css
    |--bar/
    |  |--bar.css (imports style.css)
    |  |--style.css

The first "style.css" resolved resource is then cached and will be given
to any request asking for "style.css".

To avoid those issues, this commit improves the `ResourceTransformer`
implementations to calculate the absolute request path before asking the
chain to resolve the resource URL, thus avoiding duplications.
The resource chain will be then asked to resolve "/foo/style/css" or
"/bar/style.css".

Issue: SPR-14597
2016-10-11 17:45:34 +02:00
Sebastien Deleuze
9bf8489afd Remove duplicated elements in CorsConfiguration#combine()
Issue: SPR-14792
2016-10-11 10:38:34 +02:00
Sebastien Deleuze
196c73fa50 Polish CorsConfigurationTests 2016-10-11 10:03:12 +02:00
Stephane Nicoll
ab232a5386 Polish EnableAsync javadoc
Issue: SPR-14793
2016-10-11 08:21:52 +02:00