Commit Graph

1567 Commits

Author SHA1 Message Date
Rossen Stoyanchev 3eee118b44 Polish 2018-11-26 16:00:47 -05:00
Ondrej Kraus 959cf61647 Sanitize request fragment in ResourceUrlEncodingFilter
Prior to this change, ResourceUrlEncodingFilter would try to resolve
the resource path using request URL without removing fragment first,
whereas only paths should be used.

This commit synchronizes behavior of ResourceUrlEncodingFilter with
behavior of ResourceUrlProvider.

Issue: SPR-17535
2018-11-26 13:48:48 -05:00
Juergen Hoeller ae8f680d2e Polishing 2018-11-22 18:21:56 +01:00
Juergen Hoeller bf272b0b21 Nullability fine-tuning based on IntelliJ IDEA 2018.3 inspection
Issue: SPR-15540
2018-11-22 16:12:38 +01:00
Rossen Stoyanchev 0134c9d608 Update @since version after backport 2018-11-21 09:35:33 -05:00
Brian Clozel 5fe628a811 Polish 2018-11-21 10:27:49 +01:00
Rossen Stoyanchev a55ca56e34 BEST_MATCHING_HANDLER_ATTRIBUTE for spring-webmvc
Issue: SPR-17518
2018-11-20 22:31:02 -05:00
Juergen Hoeller ce5c65c0b0 Upgrade to JAXB 2.3.1, Groovy 2.5.4, Jetty 9.4.14, Tomcat 9.0.13
Includes JAX-WS 2.3.1, Awaitility 3.1.3, OkHttp 3.12, Woodstox 5.2.
2018-11-19 12:41:26 +01:00
Stephane Nicoll 7b6f2f8fb3 Polish contribution
Closes gh-2019
2018-11-19 08:45:33 +01:00
Hanope bfb49c7249 Fix typos
See gh-2019
2018-11-19 08:41:21 +01:00
HeemangHan 729ce4108d Correct typos (#2018) 2018-11-17 16:31:01 +01:00
Rossen Stoyanchev c89e6c616a Improve logging of request mapping information
Issue: SPR-17450
2018-11-16 17:30:18 -05:00
Juergen Hoeller 40148c0560 Consistent use of ResolvableType.toClass() for assignability checks
Issue: SPR-17086
2018-11-12 20:29:37 +01:00
Juergen Hoeller c58da71006 Synthesize parameter annotations from interface methods as well
Issue: SPR-17460
2018-11-12 16:23:14 +01:00
Juergen Hoeller b1f5f51503 Synchronized onRefresh execution for concurrent ContextRefreshedEvent
Issue: SPR-17442
2018-11-05 19:27:43 +01:00
Juergen Hoeller f65408f646 Avoid references to groovy-all artifact across all modules
Issue: SPR-17446
2018-11-05 12:27:07 +01:00
Juergen Hoeller 991e9f4269 Upgrade to Joda-Time 2.10.1 2018-10-29 18:33:36 +01:00
Juergen Hoeller 3fee8cb625 Polishing 2018-10-26 11:43:46 +02:00
Juergen Hoeller f32e1bcbe3 Polishing 2018-10-26 11:07:29 +02:00
Brian Clozel 2146e13787 Fix absolute paths when transforming resources
Prior to this commit, `ResourceTransformerSupport.toAbsolutePath`
would call `StringUtils.applyRelativePath` in all cases. But this
implementation is prepending the given path even if the relative path
starts with `"/"`.

This commit skips the entire operation if the given path is absolute,
i.e. it starts with `"/"`.

Issue: SPR-17432
2018-10-25 16:42:47 +02:00
Juergen Hoeller 67bd3f670f Upgrade to AspectJ 1.9.2, Rome 1.11.1, OpenPDF 1.2.5, POI 4.0 2018-10-25 15:15:47 +02:00
Brian Clozel 50a4769162 Fix ResourceUrlEncodingFilter lifecycle
Prior to this commit, the `ResourceUrlEncodingFilter` would wrap the
response and keep a reference to the request. When
`HttpServletResponse.encodeURL` is later called during view rendering,
the filter looks at the request and extracts context mapping information
in order to resolve resource paths in views.

This approach is flawed, when the filter is used with JSPs - if the
request is forwarded to the container by the `InternalResourceView`,
the request information is overwritten by the container. When the view
is being rendered, the information available in the request is outdated
and does not allow to correctly compute that context mapping
information.

This commit ensures that that information is being extracted from the
request as soon as the `ResourceUrlProvider` is set as a request
attribute.

Issue: SPR-17421
2018-10-24 21:18:57 +02:00
Juergen Hoeller ffa032e78f Polishing 2018-10-24 20:46:26 +02:00
Rossen Stoyanchev 41e6aa6de2 Restore log level for resolved exceptions
The fix for SPR-17178 switched from debug to warn level warning for
all sub-classes of AbstractHandlerExceptionResolver where the request
concerned the DefaultHandlerExceptionResolver only.

This commit restores the original DEBUG level logging that was in
AbstractHandlerExceptionResolver from before SPR-17178. In addition
DefaultHandlerExceptionResolver registers a warnLogCategory by default
which enables warn logging and hence fulfilling the original goal
for SPR-17178.

Issue: SPR-17383
2018-10-22 12:13:18 -04:00
Rossen Stoyanchev de453ace86 Revert "@ExceptionHandler methods logs at DEBUG level again"
This reverts commit 162112.

Instead we'll go for a bigger rollback of the change from SPR-17178 so
that only DefaultHandlerExceptionResolver does warn logging by default.

Issue: SPR-17388
2018-10-22 11:46:02 -04:00
Rossen Stoyanchev 1621125ccf @ExceptionHandler methods logs at DEBUG level again
Issue: SPR-17383
2018-10-18 22:49:47 -04:00
Juergen Hoeller 93bb78ec23 Avoid private bean classes in integration tests (for CGLIB on JDK 11)
Issue: SPR-16391
2018-10-15 12:26:38 +02:00
Rossen Stoyanchev bb5c8ed4e8 Correct Javadoc in ServletUriComponentsBuilder
Replace all method level comments related to forwaded headers, some
current and some outdated, with a single class-level comment.

Issue: SPR-17317
2018-10-09 16:51:41 -04:00
Juergen Hoeller c385a1de83 Polishing 2018-09-17 15:17:39 +02:00
Juergen Hoeller 34663300a6 Avoid regex pattern matching for simple String replacement steps
Issue: SPR-17279
2018-09-17 14:22:19 +02:00
Simon Bowring cc87fbcb7f Fix javadoc comments to match behaviour 2018-09-17 12:25:39 +02:00
Rossen Stoyanchev db8e9eafb2 Add LogFormatUtils
1. Helper method to eliminate duplication in formatting (de-)serialized
   values for logging introduced with prior commit #e62298.

2. Helper method for TRACE vs DEBUG logging with different details.

Issue: SPR-17254
2018-09-14 18:06:46 -04:00
Rossen Stoyanchev e62298eaad Truncate logged encoded and decoded values if necessary
At DEBUG show up to 100 chars, at TRACE show full formatted value.

Note that the formatValue helper method is duplicated a number of times
in this commit. A utility method will likely be added in spring-core
through an extra commit.

Issue: SPR-17254
2018-09-14 12:20:03 -04:00
Juergen Hoeller 66c66baa8f Upgrade to Rhino 1.7.10
Includes reordering of web dependency declarations.
2018-09-14 14:03:53 +02:00
Juergen Hoeller cbc0fad961 Upgrade to Kotlin 1.2.70
Includes Hibernate ORM 5.1.16 and Hibernate Validator 6.0.13.
2018-09-13 18:23:42 +02:00
Juergen Hoeller e49896d95f Upgrade to Mockito 2.22, XMLUnit 2.6.2, JavaMail 1.6.2
Also includes Apache Johnzon 1.1.9.
2018-09-10 10:52:24 +02:00
Juergen Hoeller 6c487f7799 Revise ServletUriComponentsBuilder javadoc
Issue: SPR-17255
2018-09-07 18:11:18 +02:00
figueroaRicardo aa848d54ff Fix typo on javadoc
`ForwardedHeaderFilter` instead of `ForwardedHeaderFiller`
2018-09-07 18:00:06 +02:00
Juergen Hoeller 3067682347 Upgrade to Hibernate ORM 5.3.6 and OpenPDF 1.2.2 2018-09-04 23:02:35 +02:00
Kei KATO c2585073ba Fix typos
Closes gh-894
2018-09-03 10:05:14 +02:00
Juergen Hoeller 03f1920106 Support Jackson filters in combination with serialization view
Issue: SPR-17209
2018-08-24 12:06:52 +02:00
Sam Brannen 2bb15f7ed2 Fix grammar in JavaDoc for fully qualified links
This commit represents a best effort attempt at fixing remaining
"a" vs. "an" grammatical errors related links specified via a fully
qualified class name.

Issue: SPR-17208
2018-08-23 17:59:44 +02:00
Juergen Hoeller a6a6cf7d97 Upgrade to Java Activation Framework 1.2 as API dependency
Includes XMLUnit 2.6.1 and Undertow 2.0.13.

Issue: SPR-16115
2018-08-17 16:01:15 +02:00
Rossen Stoyanchev ad88c02bc3 Restore formatting change following revert 2018-08-17 09:53:47 +03:00
Rossen Stoyanchev 498984324d Revert "Add handleFailure property to FrameworkServlet"
This reverts commit 29ce6685ca.
2018-08-17 09:47:00 +03:00
Juergen Hoeller 04d2d1da0d Consistently use double quotes (even if no interpolation needed)
Includes upgrade to Hibernate ORM 5.3.5, EclipseLink 2.7.3, Selenium HtmlUnit Driver 2.32.1, Jetty 9.4.12 RC2.
2018-08-16 15:32:44 +02:00
Juergen Hoeller 5d7fb1a1c2 Polishing 2018-08-16 12:08:26 +02:00
Brian Clozel f2506ca7a1 Revert "Infer HTTP 404 from empty Optional/Publisher types"
This reverts commit 7e91733502.
2018-08-15 15:15:35 +02:00
Brian Clozel 7e91733502 Infer HTTP 404 from empty Optional/Publisher types
This commit handles "empty" cases for `ResponseEntity` controller
handler return types when wrapped with a `java.util.Optional` in Spring
MVC or a single `Publisher` like `Mono`.

Given the following example for Spring MVC:

```
@GetMapping("/user")
public Optional<ResponseEntity<User>> fetchUser() {
	Optional<User> user = //...
	return user.map(ResponseEntity::ok);
}
```

If the resulting `Optional` is empty, Spring MVC will infer a
`ResponseEntity` with an empty body and a 404 HTTP response status.

The same reasoning is applied to Spring WebFlux with Publisher types:

```
@GetMapping("/user")
public Mono<ResponseEntity<User>> fetchUser() {
	Mono<User> user = //...
	return user.map(ResponseEntity::ok);
}
```

This feature is only valid for `HttpEntity` return types and does not
apply to `@ResponseBody` controller handlers.

Issue: SPR-13281
2018-08-15 11:59:16 +02:00
Rossen Stoyanchev 04141dee65 Consistent logging of resolved exceptions
Issue: SPR-17178
2018-08-15 10:57:51 +03:00