Commit Graph

354 Commits

Author SHA1 Message Date
Juergen Hoeller 5661d3826c Fixed Jackson2ObjectMapperFactoryBean class name in javadoc examples 2014-01-05 00:15:33 +01:00
Juergen Hoeller 11b3fe2289 Added setModulesToInstall with convenient Class vararg, renamed setFindModules to setFindModulesViaServiceLoader, made existing setModules override any other setting
Issue: SPR-11040
2014-01-04 23:29:05 +01:00
Rossen Stoyanchev 12fe9174f0 Make ObjectMapper configurable in spring-messaging
Issue: SPR-11279
2014-01-02 11:27:18 -05:00
Juergen Hoeller 0657136605 Support for Jackson's findModules and autodetection of JSR-310 and Joda-Time support
Issue: SPR-11040
2013-12-29 21:52:58 +01:00
Juergen Hoeller 85921808b3 MappingJackson2(Http)MessageConverter logs warnings after canRead/canWrite checks
This change involves a general upgrade to Jackson 2.3 in our build.

Issue: SPR-11261
2013-12-29 21:50:43 +01:00
Juergen Hoeller 260bbe319d Fixed accidental use of Java 8 getParameterCount(), plus polishing of related classes
Issue: SPR-11245
2013-12-18 18:08:32 +01:00
Rossen Stoyanchev ff92f5af57 Fix typo
Issue: SPR-11241
2013-12-17 08:26:50 -05:00
Juergen Hoeller 2a3ca619f9 Polishing
Issue: SPR-11221
2013-12-17 12:40:21 +01:00
Rossen Stoyanchev 5f38996cd6 Add methods for static resolution of @ExceptionHandler 2013-12-09 08:19:17 -05:00
Juergen Hoeller f70739430b Polishing 2013-12-08 23:27:31 +01:00
Juergen Hoeller ea8a2095ec Polishing 2013-12-06 21:51:18 +01:00
Juergen Hoeller 2a52decbbc Polishing (including removal of javadoc imports that show as package cycles in IntelliJ) 2013-12-02 23:57:00 +01:00
Phillip Webb 043a41e382 Consistent whitespace after imports
Update code to have a consistent number of new-line characters after
import statements.
2013-11-26 15:14:43 -08:00
Phillip Webb 15698860e1 General polish of new 4.0 classes
Apply consistent styling to new classes introduced in Spring 4.0.

- Javadoc line wrapping, whitespace and formatting
- General code whitespace
- Consistent Assert.notNull messages
2013-11-26 15:11:18 -08:00
Phillip Webb a31ac882c5 Fix various javadoc warnings 2013-11-26 13:25:37 -08:00
Eric Dahl e9f78f6043 Fix various typos
Fix a variety of typos throughout the project, primarily in
comments (javadoc or otherwise) but also in a handful of log messages
and a couple exception messages.

ISSUE: SPR-11123
2013-11-25 15:58:27 -08:00
Phillip Webb 59002f2456 Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.

Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.

Issue: SPR-11064
2013-11-25 12:52:42 -08:00
Juergen Hoeller 0de112198e Rely on presence of Servlet 2.5's ServletContext.getContextPath() 2013-11-20 14:50:32 +01:00
Brian Clozel cc4faa5990 Fix standard multipart binding + Polish
Fixing standard multipart binding when multiple parts share
the same name.

Uncomment previously @Ignored tests now that Jetty supports
Servlet 3.0 spec.

Issue: SPR-10591
2013-11-19 17:13:31 -08:00
Juergen Hoeller b43901ed86 Upgraded to JSF 2.0 baseline; building against JSF 2.2 now 2013-11-15 12:07:42 +01:00
Rossen Stoyanchev 2ae6a6a341 Disable ext entities in SourceHttpMessageConverter
This change disables the processing of external entities in
SourceHttpMessageConverter by default and provides an option to enable
it if required.
2013-11-05 09:23:20 -05:00
Rossen Stoyanchev bfa6c2d5a2 Tweak method signatures in HttpComponentsClientHttpRF
This change replaces CloseableHttpClient with HttpClient in the
methods signatures of HttpComponentsClientHttpRequestFactory.
This allows 3rd party libraries such as Spring OAth, which configure
an instance of HttpComponentsClientHttpRequestFactory on the
RestTemplate to remain compatible with both Spring Framework 3/4

Issue: SPR-11053
2013-10-31 11:10:35 -04:00
Juergen Hoeller 84bc474016 Upgraded to Apache HttpComponents HttpClient 4.3.1 and HttpAsyncClient 4.0 GA, as well as Jackson 2.2.2 2013-10-31 15:26:11 +01:00
Sam Brannen 2e6c998168 Update Javadoc for mocks regarding Servlet 3.0
Commit deba32cad9 upgraded the Servlet API mocks to Servlet 3.0;
however, not all of the Javadoc was updated accordingly.

This commit updates the remaining Javadoc with regard to Servlet 3.0 as
the baseline for mocks in the spring-test module.

In addition, this commit syncs up the mocks used for internal testing in
the spring-web module with the most current versions from spring-test.

Issue: SPR-11049
2013-10-31 11:51:15 +01:00
Rossen Stoyanchev 5d8fac86d7 Add timeout async request handling to OSIV components
This change adds async web request timeout handling to OSIV filters
and interceptors to ensure the session or entity manager is released.

Issue: SPR-10874
2013-10-30 22:54:21 -04:00
Brian Clozel 397d52ad17 Upgrade to Jetty 9.1.0 .RC0
This commit upgrades Jetty to the latest available 9.1.x version while
also preserving compatibility with 9.0.x.
2013-10-29 15:02:25 -04:00
Rossen Stoyanchev 81dda069af Update WebSocket extensions change
- add WebSocketHttpHeaders
- client-side support for WebSocket extensions
- DefaultHandshakeHandler updates
- replace use of ServletAttributes in JettyRequestUpgradeStratey
- upgrade spring-web to jetty 9.0.5
2013-10-28 22:40:22 -04:00
Rossen Stoyanchev cf5db8362b Replace MvcUrls with MvcUriComponentsBuilder
Issue: SPR-8826
2013-10-25 22:29:38 -04:00
Phillip Webb 12e896ed8b Polish 2013-10-25 16:42:47 -07:00
Rossen Stoyanchev bafc73f147 Integrate suggested support for creating MVC URLs
The key contract is MvcUrls. An instance is automatically created with
the Spring MVC namespace and the MVC Java config but can also be easily
created in any configuration.

Some example tests can be found in DefaultMvcUrlsTests.

Issue: SPR-10665, SPR-8826
2013-10-21 16:26:08 -04:00
Oliver Gierke 4fd27b12fc Introduced MvcUriComponentsBuilder to create URIs pointing to controller methods.
MvcUriComponentsBuilder allows creating URIs that point to Spring MVC
controller methods annotated with @RequestMapping. It builds them by
exposing a mock method invocation API similar to Mockito, records the
method invocations and thus builds up the URI by inspecting the mapping
annotations and the parameters handed into the method invocations.

Introduced a new SPI UriComponentsContributor that should be implemented 
by HandlerMethodArgumentResolvers that actually contribute path segments 
or query parameters to a URI. While the newly introduced 
MvcUriComponentsBuilder looks up those UriComponentsContributor instances 
from the MVC configuration.

The MvcUriComponentsBuilderFactory (name to be discussed - MvcUris maybe?) 
prevents the multiple lookups by keeping the UriComponentsBuilder 
instances in an instance variable. So an instance of the factory could 
be exposed as Spring bean or through a HandlerMethodArgumentResolver to 
be injected into Controller methods.

Issue: SPR-10665, SPR-8826
2013-10-21 16:26:07 -04:00
Rossen Stoyanchev 4f28c77db7 Polish ControllerAdvice selectors
Issue: SPR-10222
2013-10-18 12:24:55 -04:00
Brian Clozel c4a8bf9c4d Add new features on @ControllerAdvice
Prior to this commit, @ControllerAdvice annotated beans would
assist all known Controllers, by applying @ExceptionHandler,
@InitBinder, and @ModelAttribute.

This commit updates the @ControllerAdvice annotation,
which accepts now base package names, assignableTypes,
annotations and basePackageClasses.

If attributes are set, only Controllers that match those
selectors will be assisted by the annotated class.
This commit does not change the default behavior when
no value is set, i.e. @ControllerAdvice().

Issue: SPR-10222
2013-10-18 11:35:06 -04:00
Juergen Hoeller 187b681b9e Consistency between InvocableHandlerMethod in web and messaging modules 2013-10-16 01:51:48 +02:00
Juergen Hoeller 3bd6dfe047 Autowiring of generic types
Includes revisions of MethodParameter and DependencyDescriptor (in particular towards a reference to the containing class). Also refines several ResolvableType method signatures.

Issue: SPR-9965
2013-10-15 00:11:23 +02:00
Juergen Hoeller 74794190a5 Implement java.io.Flushable wherever applicable 2013-10-14 23:52:31 +02:00
Rossen Stoyanchev 8ae88c20d1 Add support for resolving message headers
This change adds support for @Header and @Headers annotated method
arguments to spring-messaging. Also supported are arguments of type
MessageHeaders, and MessageHeaderAccessor (including sub-types of
MessageHeaderAccessort as long as they provide a wrap(Message<?>)
static factory method).

This change also renames @MessageBody to @Payload.

Issue: SPR-10985
2013-10-13 11:13:16 -04:00
Phillip Webb ca9df4d2ef Return rather than throw converted http exception
Fix HttpInvokerClientInterceptor.convertHttpInvokerAccessException to
return the translated exception rather than throwing it. This brings
the method implementation in line with the Java Doc and the obvious
original intent.

Issue: SPR-10965
2013-10-11 14:47:58 -07:00
Juergen Hoeller 4574528a27 Comprehensive update to the framework's TimeZone handling, including a new TimeZoneAwareLocaleContext and a LocaleContextResolver for Spring MVC
A few noteworthy minor changes: LocaleContext.getLocale() may return null in special cases (not by default), which our own accessing classes are able to handle now. If there is a non-null TimeZone user setting, we're exposing it to all collaborating libraries, in particular to JSTL, Velocity and JasperReports. Our JSR-310 and Joda-Time support falls back to checking the general LocaleContext TimeZone now, adapting it to their time zone types, if no more specific setting has been provided. Our DefaultConversionService has TimeZone<->ZoneId converters registered. And finally, we're using a custom parseTimeZoneString method now that doesn't accept the TimeZone.getTimeZone(String) GMT fallback for an invalid time zone id anymore.

Issue: SPR-1528
2013-10-04 23:14:08 +02:00
Juergen Hoeller 52cca48f40 Polishing 2013-10-04 22:53:49 +02:00
Juergen Hoeller 8b3afda6f4 Marked Jackson 1.x support classes as deprecated 2013-10-04 22:52:47 +02:00
Brian Clozel a5e3916724 Add Jackson's Modules registration in Jackson2OMFactoryBean
Prior to this commit, one couldn't configure Jackson's ObjectMapper
with (De)SerializerModifiers or advanced configuration features
using XML configuration.

This commit updates the FactoryBean and adds a setModule method
that will register Modules with the ObjectMapper.

Note that this commit is only about XML configuration, since
this feature was already available with JavaConfig.

Issue: SPR-10429
2013-10-02 17:23:55 -04:00
Brian Clozel e91ce23cd0 Add javax.servlet.http.Part support for data binding
Prior to this commit, Multipart databinding would only support
MultiPartFile databinding using commons-multipart.

Now the WebRequestDataBinder supports Part and List<Part>
databinding for Servlet 3.0 compliant containers.

Issue: SPR-10591
2013-10-02 17:19:44 -04:00
Rossen Stoyanchev 92795f463a Polish
Issue: SPR-10539
2013-09-25 12:47:50 -04:00
Brian Clozel 2dd4480103 Add IPv6 support in RestTemplate
Prior to this commit, RestTemplate would not would
not accept IPv6 raw addresses in URLs because UriComponentsBuilder
would not parse/encode the Host part correctly.

The UriComponentsBuilder now parses and encode raw IPv6 addresses
in the "[1abc:2abc:3abc::5ABC:6abc]" format and also supports the
use of IPv6 scope_ids (see JDK8 java.net.Inet6Address),
like "[1abc:2abc:3abc::5ABC:6abc%eth0]".

Issue: SPR-10539
2013-09-25 16:28:12 +02:00
Juergen Hoeller 5e88fe5842 Clarified Spring 4.0's dependency on JAX-WS 2.1+ / JAXB 2.1+ in javadoc 2013-09-25 12:54:25 +02:00
Arjen Poutsma d0aa158aef Added ListenableFuture interface
Added extension to Future with capabilities for registering callbacks
when the future is complete.

- Added ListenableFuture, ListenableFutureCallback,
  ListenableFutureCallbackRegistry, and ListenableFutureTask.
- Using ListenableFuture in AsyncRestOperations/AsyncRestTemplate.
- Added AsyncListenableTaskExecutor, implemented in
  SimpleAsyncTaskExecutor.
- Added FutureAdapter and ListenableFutureAdapter.
2013-09-04 14:32:47 +02:00
Arjen Poutsma e33324b700 Changed Future<Void> to Future<?>
Changed return values of Future<Void> to Future<?> in AsyncRestTemplate
and AsyncRestOperations.
2013-09-02 15:33:30 +02:00
Oleg Kalnichevski 296e2189a2 Post SPR-8804 optimizations: better use of HC 4.3 APIs 2013-08-29 13:28:00 +02:00
Juergen Hoeller 38c8c6d085 Turned AsyncRequestCallbackAdapter into a private inner class
Issue: SPR-8804
2013-08-28 12:56:18 +02:00