Commit Graph

935 Commits

Author SHA1 Message Date
Juergen Hoeller
c9943aacc5 Timeout exceptions as RuntimeExceptions
Issue: SPR-14669
(cherry picked from commit e947363)
2016-09-15 10:05:04 +02:00
Rossen Stoyanchev
9fa2a46d35 Improve async request timeout handling
Rather than setting the status to 503 directly from the timeout
interceptor which no longer seems to work reliably with Servlet
containers like Jetty even performing an additional ERROR dispatch back
to the original URL, we know rather set the DeferredResult to an
AsyncTimeoutException, which results in a dispatch and standard
handling within Spring MVC. This should be a more reliable way of
dealing with timeouts.

Issue: SPR-14669
2016-09-14 21:37:30 -04:00
Juergen Hoeller
b344c927bd Polishing
(cherry picked from commit 040d131)
2016-09-13 22:59:09 +02:00
Juergen Hoeller
5b0722ed28 Polishing
(cherry picked from commit e828be9)
2016-08-26 18:10:43 +02:00
Juergen Hoeller
d03afeb296 Consistent use of Charset.forName over JDK 7 StandardCharsets in 4.x line
(cherry picked from commit 2a82b8f)
2016-08-26 18:10:27 +02:00
Juergen Hoeller
081c3ac44f Polishing 2016-08-24 12:46:30 +02:00
Juergen Hoeller
aac0e632ae Various @since tags (and varargs on setInterceptors) 2016-08-18 12:31:21 +02:00
Juergen Hoeller
96f1a0ecae Polishing 2016-08-18 10:50:56 +02:00
Juergen Hoeller
22ca7ac927 Polishing
(cherry picked from commit c926ec4)
2016-08-17 18:04:00 +02:00
Juergen Hoeller
7b33cd6476 Polishing
(cherry picked from commit 67ba187)
2016-08-10 15:50:47 +02:00
Juergen Hoeller
a39276addc Polishing 2016-07-20 23:22:06 +02:00
Juergen Hoeller
b5127dc152 Polishing 2016-07-20 22:16:35 +02:00
Juergen Hoeller
392f9c8deb Javadoc fixes and pruning of deprecated references
(cherry picked from commit 69dd40e)
2016-07-15 23:01:14 +02:00
Juergen Hoeller
e4179553b6 AbstractHandlerMethodMapping adds type+method info to getMappingForMethod exceptions
Issue: SPR-14452
(cherry picked from commit f0a826e)
2016-07-15 17:08:18 +02:00
Juergen Hoeller
82ca2011e3 Configurable UrlPathHelper in PathExtensionContentNegotiationStrategy
This commit also aligns ResourceUrlProvider's and RequestMappingInfo's UrlPathHelper setter/getter signatures.

Issue: SPR-14454
(cherry picked from commit 5c3c0f7)
2016-07-15 17:08:06 +02:00
Juergen Hoeller
0445ce6c53 Polishing (backported from master)
(cherry picked from commit 92d78c1)
2016-07-06 17:35:30 +02:00
Juergen Hoeller
cd37873971 Avoid stateful MethodParameter nesting level changes in MVC processing
(cherry picked from commit e7a53e3)
2016-07-02 14:07:11 +02:00
Juergen Hoeller
4ddd9572f7 Leniently accept custom DeferredResult etc subclasses for null values
Issue: SPR-14423
(cherry picked from commit cfc560c)
2016-07-02 14:07:04 +02:00
Juergen Hoeller
a63247b281 Polishing 2016-06-29 16:07:03 +02:00
Juergen Hoeller
dd7ddc08ff Polishing 2016-06-29 14:48:09 +02:00
Rossen Stoyanchev
269742589b Improve static resource path check 2016-06-28 16:50:32 -04:00
Juergen Hoeller
e219576414 Defensive catching of any Throwable subclasses instead of just Error
Issue: SPR-14329
Issue: SPR-14323
(cherry picked from commit a9fda3e)
2016-06-04 00:27:24 +02:00
Juergen Hoeller
899131997e Less restrictive CORS origin comparison
UriComponentsBuilder allows more efficient (and less restrictive) CORS
origin comparison.

Also introduces a specifically narrowed cloneBuilder() method for
UriComponentsBuilders.

Cherry-picked from 9a52c8.

Issue: SPR-14080
2016-05-31 12:25:16 -04:00
Juergen Hoeller
07b5763324 SpringTilesContainerFactory uses Tiles 3's createDecoratedContainer
Issue: SPR-14311
(cherry picked from commit 2d85acc)
2016-05-31 13:21:38 +02:00
Juergen Hoeller
7b73f23f43 For attribute is not actually required
Issue: SPR-14287
(cherry picked from commit dacc31e)
2016-05-31 13:21:06 +02:00
Rossen Stoyanchev
6314df367c Update spring-mvc-3.2.xsd
The backport in commit cf39078 changed the spring-mvc-3.2.xsd.
This change updates the same in the 4.2.x branch.

Issue: SPR-14186
2016-04-21 14:07:27 -04:00
Juergen Hoeller
b7890ca28e Consistent license header
(cherry picked from commit 537193a)
2016-04-11 21:14:05 +02:00
Juergen Hoeller
aa5c12c534 Polishing 2016-04-08 22:52:36 +02:00
Juergen Hoeller
756301b7c5 Polishing
(cherry picked from commit 94cb778)
2016-03-25 23:38:23 +01:00
Juergen Hoeller
ccaa504378 Polishing
(cherry picked from commit 775bccc)
2016-03-24 21:47:56 +01:00
Juergen Hoeller
0891fbaf97 Consistent formatting 2016-03-24 19:54:28 +01:00
Juergen Hoeller
2ea7fcde3e Polishing
(cherry picked from commit 9af12d2)
2016-03-24 17:17:58 +01:00
Juergen Hoeller
8994498b44 Revised newline handling tests pass on Windows now
Issue: SPR-13503
(cherry picked from commit 311d4c9)
2016-03-24 17:16:52 +01:00
Brian Clozel
ed34ea4876 Reset Expires HTTP header when caching configured
Just like SPR-13252 addressed this issue for the "Pragma" header, this
issue resets the HTTP 1.0 "Expires" header.
When such a header has been set (by a filter, for example) and HTTP
caching has been configured at the WebContentGenerator, this header
value is reset to "". In this case, "Cache-Control" and "Expires" might
have inconsistent values and we consider that the HTTP caching
configuration should take precedence.

Depending on the servlet container chosen to deploy the application,
this might result in empty "" header values or no header set at all.

Issue: SPR-14053
Cherry picked from 15fe8279e6
2016-03-23 16:35:53 +01:00
Kazuki Shimizu
2267b14055 Add newline at the beginning of textarea macro for FreeMarker and Velocity
Issue: SPR-13503
Cherry-picked from 9b2023111d
2016-03-23 11:56:28 +01:00
Rossen Stoyanchev
d7062f6291 Ensure RedirectModel is initialized
This commit fixes an old bug in ModelAndViewContainer where getModel
returns a new ModelMap instance that isn't saved and re-used.

Issue: SPR-14045
2016-03-14 23:04:58 -04:00
Brian Clozel
f76b38c506 Fix SpringUrl Velocity macro URI encoding
Prior to this commit, the springUrl Velocity macro would only prepend
the context to the given URL; this means that the
ServletHttpResponse.encodeUri method is not called and neither the
ResourceUrlProvider.

This commit changes this macro to use RequestContext.getContextUrl which
prepends the context and encodes the URI.

Issue: SPR-14027
Cherry-picked from 0a56667093
2016-03-08 18:01:29 +01:00
Brian Clozel
b88c39955b Add newline at the beginning of textarea JSP tags
This commit adds a newline char at the beginning of textarea tags
values. As per the HTML 4.01 spec (and browsers behavior), a line break
following a start tag is ignored.

This can lead to Spring's textarea tag to ignore a line break char at
the beginning of a tag value.

See https://www.w3.org/TR/html401/appendix/notes.html#notes-line-breaks

Issue: SPR-13503
Cherry picked from 44c32128
2016-03-03 16:52:16 +01:00
Brian Clozel
0ef90df120 Relax SPR-13867 changes for ResourceHttpRequestHandler
Prior to this change, SPR-13867 made sure that any class extending
WebContentGenerator would not overwrite existing HTTP "Cache-Control"
response headers - set by a filter, a Controller handler, etc.

This caused issues with resource handling, since specifying a cache
configuration there would not overwrite default headers set by filters,
for example by Spring Security.

This commit restricts the previous changes to the
RequestMappingHandlerAdapter, in order to avoid overwriting header set
by a filter or a Controller handler in those cases.

Issue: SPR-14005
Cherry-picked from 50bcd67fb6
2016-03-02 17:45:50 +01:00
Juergen Hoeller
8a44560d82 RequestMappingHandlerAdapter properly invokes handler method in case of no session as well
Issue: SPR-13999
(cherry picked from commit a02fd7c)
2016-02-29 15:08:00 +01:00
Juergen Hoeller
0349abc565 RequestMappingHandlerAdapter properly invokes handler method in synchronizeOnSession mode again
Issue: SPR-13999
(cherry picked from commit 1815a6a)
2016-02-29 11:46:16 +01:00
Juergen Hoeller
9c5cabf4ba Refined ApplicationContextInitializer assignability exception
(cherry picked from commit ca19920)
2016-02-24 17:58:29 +01:00
Juergen Hoeller
a620770470 Polishing 2016-02-19 16:02:25 +01:00
Rossen Stoyanchev
6ef2d827c6 Reduce log level for @ExceptionHandler failure
Issue: SPR-13932
2016-02-09 12:58:08 -05:00
Juergen Hoeller
e48315549e AbstractXlsView does not explicitly flush (for compatibility with WebSphere Liberty)
Issue: SPR-13910
(cherry picked from commit 28e8af2)
2016-02-04 20:49:48 +01:00
Juergen Hoeller
30ef893c28 Polishing 2016-01-26 22:23:56 +01:00
Juergen Hoeller
a58eee6ad1 RequestParamMethodArgumentResolver defensively handles MethodParameter nesting level and java.util.Optional access
Issue: SPR-13850
2016-01-26 22:07:27 +01:00
Brian Clozel
bcebc9db7e Register prefixed path patterns with FixedVersionStrategy
Prior to this change, configuring a `FixedVersionStrategy` like so
would configure a single "/js/**" path pattern:

```
versionResourceResolver.addFixedVersionStrategy("v1.0.0","/js/**");
```

This commit makes sure that for each path pattern, its prefixed version
is added to the map. For example, the previous configuration also
adds "/v1.0.0/js/**".

Issue: SPR-13883
cherry-picked from 84fe46cd
2016-01-22 19:03:52 +01:00
Brian Clozel
fc34b0c592 Reorder HTTP headers processing in RequestMappingHandlerAdapter
Prior to this change, the `RequestMappingHandlerAdapter` would first add
a "Cache-Control" HTTP header to the response (depending on its
`WebContentGenerator` configuration and `@SessionAttributes` on the
handler class); then, the Adapter would delegate the actual handler the
processing of the request.
This leads to issues, as the handler does not have full control to the
response and has to deal with pre-existing headers in the response. This
means that the Adapter and the handler can add incompatible
Cache-Control directives without knowing it, since one cannot see the
headers added by the other until the response is committed.

This commit switches the order of execution: first, the handler is
called (possibly adding HTTP headers), then the RMHA processes the
response and adds "Cache-Control" directives *only if there's no
Cache-Control header already defined*.

Issue: SPR-13867
cherry-picked from 8f1d06f19
2016-01-22 16:36:48 +01:00
Brian Clozel
a4cb3cf900 Fix OutOfBoundsException in ResourceUrlEncodingFilter
Prior to this change, the `ResourceUrlEncodingFilter` would try to
lookup resources URLs as soon as the given URL would be longer than the
expected context+servlet prefix path. This can lead to
OutOfBoundsExceptions when the provided URL does not start with that
prefix and still has the required length.

This commit makes sure that all candidate URLs for resources lookup are
prefixed with the cached servlet and context path. This underlines the
fact that the `ResourceUrlEncodingFilter` does not support relative URLs
for now and delegates to the native servlet implementation in that case.

Issue: SPR-13861
cherry-picked from 2f6d86b7
2016-01-21 17:39:37 +01:00