Commit Graph

8704 Commits

Author SHA1 Message Date
Stephane Nicoll bb6e07bd3a polishing 2014-05-26 13:39:38 +02:00
Stephane Nicoll 05041ff39a Update JMS documentation
This commit updates the JMS documentation regarding the side effects
of not using the  cache with a non durable subscriber.

Issue: SPR-7883
2014-05-26 10:40:32 +02:00
Stephane Nicoll 9fabcad3dd Revisit JmsMessagingTemplate
This commit revisits JmsMessagingTemplate and adds support for
receiving operations as well. JmsMessageSendingOperations has been
renamed to JmsMessageOperations.

The messaging abstraction did not split receiving and request-reply
operations. AbstractMessageReceivingTemplate has been created to hold
only the receiving operations.

Issue: SPR-11772
2014-05-26 09:35:03 +02:00
Brian Clozel 31c07dbfa4 Merge pull request #546 from gcuisinier/master
fix javadoc link for RestController and PropertySource
2014-05-24 22:39:20 +02:00
Gildas Cuisinier 8d306bfbc0 fix javadoc link for RestController and PropertySource 2014-05-24 18:29:52 +02:00
Rossen Stoyanchev e3a6fce403 Add Gson converter to MVC config
Issue: SPR-9488
2014-05-22 22:23:00 -04:00
Rossen Stoyanchev bc3ca2dea1 Polish 2014-05-22 22:21:52 -04:00
Roy Clarkson 811330f5c8 Add GsonHttpMessageConverter
This commit adds support to read and write JSON using the Google Gson
library. GsonHttpMessageConverter offers default Gson configuration, but
can be customized by using GsonFactoryBean. GsonFactoryBean includes
several convenience properties for configuring the internal GsonBuilder
and the resulting Gson object.

By default Gson converts byte arrays to JSON arrays instead of a Base64
encoded string. GsonBase64ByteArrayJsonTypeAdapter provides support to
read and write Base64 encoded byte arrays, and can be enabled in
GsonFactoryBean.

RestTemplate will enable GsonHttpMessageConverter only if Jackson 2 is
not found on the class path, because by default GsonHttpMessageConverter
supports the same media types as Jackson.

Issue: SPR-9488
2014-05-22 22:21:52 -04:00
Stephane Nicoll 9952973e01 Add missing cache-resolver attribute
Prior to this commit, CacheResolver could not be configured through
the XML namespace (i.e. cache:annotation-driven). This is now the
case.

Issue: SPR-11490
2014-05-21 09:03:18 +02:00
Rossen Stoyanchev 1338d46a6e Add JSONP support for MappingJackson2MessageConverter
Issue: SPR-9899
2014-05-20 12:13:44 -04:00
Stephane Nicoll 05e96ee448 Cache provider related exceptions handling
This commit adds the necessary infrastructure to handle exceptions
thrown by a cache provider in both Spring's and JCache's caching
abstractions.

Both interceptors can be configured with a CacheErrorHandler that
defines several callbacks on typical cache operations. In particular,
handleCacheGetError can be implemented in such a way that an
exception thrown by the provider is handled as a cache miss by the
caching abstraction.

The handler can be configured with both CachingConfigurer and the
XML namespace (error-handler property)

Issue: SPR-9275
2014-05-20 16:39:34 +02:00
Juergen Hoeller c7d1c49d6d Servlet 3 multipart request implements getParameterMap defensively as well
Issue: SPR-11074
2014-05-20 11:10:16 +02:00
Juergen Hoeller 6fef8b996c Polishing 2014-05-20 10:46:06 +02:00
Rossen Stoyanchev 8e096aeef5 Disable URL resolution in DTD declarations
Issue: SPR-11768
2014-05-19 22:45:12 -04:00
Juergen Hoeller 61b47ba7d9 Consistent MvcUriComponentsBuilder assertion handling 2014-05-20 01:43:01 +02:00
Juergen Hoeller a16eeabc4e Further UriComponentsBuilder javadoc revision
(cherry picked from commit 54636b3)
2014-05-20 01:26:08 +02:00
Juergen Hoeller d9b39ad691 Consistent use of IllegalStateException instead of InternalError for UnsupportedEncodingException cause 2014-05-20 00:37:09 +02:00
Juergen Hoeller 73c9d09024 UriComponentsBuilder.toUriString instead of RequestContext.getMvcUrl (breaking cyclic dependency between web.servlet.support and web.servlet.mvc) 2014-05-20 00:35:09 +02:00
Juergen Hoeller 03ce4a5024 Polishing 2014-05-20 00:31:24 +02:00
Juergen Hoeller cfc720db25 Latest patches from ASM trunk 2014-05-19 22:29:27 +02:00
Juergen Hoeller 295a6aeed6 StringUtils.parseLocaleString parses variant correctly when variant contains country code
This commit also includes a JUnit 4 style revision of StringUtilsTests and ObjectUtilsTests.

Issue: SPR-11806
2014-05-19 22:29:19 +02:00
Juergen Hoeller 1285467fe6 Consistently log Class.getName() instead of Class.toString(), avoiding double class term in log message
Issue: SPR-11804
2014-05-19 22:29:10 +02:00
Rossen Stoyanchev 51fc3b4aaf Refactor @JsonView support w/ ResponseBodyInterceptor
The newly added support for ResponseBodyInterceptor is a good fit for
the (also recently added) support for the Jackson @JsonView annotation.

This change refactors the original implementation of @JsonView support
for @ResponseBody and ResponseEntity controller methods this time
implemented as an ResponseBodyInterceptor.

Issue: SPR-7156
2014-05-19 15:47:16 -04:00
Rossen Stoyanchev 96b18c8dc2 Add ResponseBodyInterceptor
This change introduces a new ResponseBodyInterceptor interface that can
be used to modify the response after @ResponseBody or ResponseEntity
methods but before the body is actually written to the response with the
selected HttpMessageConverter.

The RequestMappingHandlerAdapter and ExceptionHandlerExceptionResolver
each have a property to configure such interceptors. In addition both
RequestMappingHandlerAdapter and ExceptionHandlerExceptionResolver
detect if any @ControllerAdvice bean implements ResponseBodyInterceptor
and use it accordingly.

Issue: SPR-10859
2014-05-19 15:47:16 -04:00
Juergen Hoeller f73a8baec7 Building against latest javax.el 2.2.x version 2014-05-19 20:31:22 +02:00
Juergen Hoeller 2619955fc3 Consistently log Class.getName() instead of Class.toString(), avoiding double class term in log message
Issue: SPR-11804
2014-05-19 20:18:50 +02:00
Juergen Hoeller 41ed228450 Refined check for NoClassDefFoundError in getTestExecutionListeners()
Issue: SPR-11804
2014-05-19 16:31:23 +02:00
Juergen Hoeller 6188550a48 ServletRequestAttributes skips well-known immutable values when updating accessed session attributes
Issue: SPR-11738
2014-05-19 16:00:29 +02:00
Juergen Hoeller 3c45bc4a50 Building against Groovy 2.3.1 2014-05-19 15:54:19 +02:00
Stephane Nicoll 7469159bf1 Add MessageSendingOperations for JMS
This commit adds a JMS implementation of MessageSendingOperations,
allowing to send JMS messages using Spring's standard Messaging
abstraction.

MessagingMessageConverter is a standard JMS's MessageConverter that
can convert Spring's Message to JMS message and vice versa. Existing
infrastructure has been updated to use this implementation.

Issue: SPR-11772
2014-05-19 10:46:13 +02:00
Juergen Hoeller 82336c320d Servlet 3 multipart request implements getParameterNames defensively (for WebLogic 12 compatibility)
This commit also includes lazy resolution support for StandardServletMultipartResolver, along the lines of existing lazy mode in CommonsMultipartResolver.

Issue: SPR-11074
Issue: SPR-11730
2014-05-18 20:26:02 +02:00
Juergen Hoeller f29d6eb5f6 Properly evaluate @Conditional in case of multiple imports for same config class (fixing regression in Spring Boot)
Issue: SPR-11788
(cherry picked from commit 7d78c65)
2014-05-18 02:05:18 +02:00
Juergen Hoeller ea88bc2c81 Servlet/PortletResponse supported as a resolvable dependency now (in particular for web controllers)
This feature required support for response exposure on Servlet/PortletRequestAttributes, instead of just in the Servlet/PortletWebRequest subclasses.

Issue: SPR-11795
2014-05-16 18:06:29 +02:00
Juergen Hoeller 5faacd5a3d JmsResourceHolder checks for nested DataSource transactions as well (for Oracle AQ compatibility)
Issue: SPR-11791
2014-05-16 15:08:09 +02:00
Juergen Hoeller 52f44b340e Properly evaluate @Conditional in case of multiple imports for same config class
Issue: SPR-11788
2014-05-16 15:06:22 +02:00
Sebastien Deleuze be0b69cbf1 Add support for Jackson serialization views
Spring MVC now supports Jackon's serialization views for rendering
different subsets of the same POJO from different controller
methods (e.g. detailed page vs summary view).

Issue: SPR-7156
2014-05-15 23:03:33 -04:00
Rossen Stoyanchev 673a497923 Await TcpClient shutdown in STOMP broker relay 2014-05-15 22:00:17 -04:00
Rossen Stoyanchev 8ee4651038 Improve StringUtils.cleanPath
Issue: SPR-11793
2014-05-15 17:26:52 -04:00
Rossen Stoyanchev 3bdf8aefa9 Polish 2014-05-15 13:59:36 -04:00
Arjen Poutsma 0499fcbeb2 Move ResponseEntityBuilder into ResponseEntity
Moved the ResponseEntityBuilder into the ResponseEntity itself.

Issue: SPR-11752
2014-05-15 13:41:25 -04:00
Stephane Nicoll 8614df8bd4 Add error code for SAP Hana
This commit adds a SQLErrorCodes instance for SAP DB, based on a
contribution from Andrew Clemons

Mostly based on SAP Hana SPS 07 with a few additional codes that are
only present is previous versions:

* -813 - Cannot connect to host somehost:30115 [Connection refused]
* -709 - Unknown host somehost:30115 [somehost], -709.]
* -708 - Cannot connect to jdbc:sap://somehost:30115 [Receive of connect failed.]
* -11210 - Invalid column index XYZ.

Issue: SPR-11770
2014-05-15 17:36:55 +02:00
Juergen Hoeller 0d22719e06 Latest possible dependency updates for spring-orm 2014-05-15 17:07:20 +02:00
Juergen Hoeller 7230d6a1aa Polishing 2014-05-15 17:07:13 +02:00
Stephane Nicoll 6560aed1c8 Avoid JMSException in listener execution
This commit avoids throwing JMSException from the listener execution
as this is not allowed per spec. Our SessionAwareMessageListener
gives a callback that can throw JMSException and we have "abused" it
so far.

Typical message processing goes in those 3 steps:
* Unmarshall the javax.jms.Message to the requested type
* Invoke the actual user method (including processing of method
  arguments)
* Send a reply message, if any

Those three steps have been harmonized so that they don't throw a
JMSException anymore. For the later case, introduced
ReplyFailureException as a general exception indicating the
reply message could not have been sent.

Issue: SPR-11778
2014-05-15 16:36:08 +02:00
Juergen Hoeller b0f0d2f289 Polishing 2014-05-15 14:39:06 +02:00
Juergen Hoeller 0728e32e7f ResultSetWrappingSqlRowSet preserves first matching column per name (as defined in ResultSet's javadoc)
Issue: SPR-11786
2014-05-15 14:27:44 +02:00
Juergen Hoeller 551950cdc0 Consistent use of ClassUtils.forName instead of class.getClassLoader().loadClass
Issue: SPR-11780
2014-05-15 09:56:11 +02:00
Brian Clozel f651065b5e Polish 2014-05-14 18:37:31 +02:00
Brian Clozel a072b3f20d Fix RestTemplate documentation for gzip encoding
Prior to this commit, RestTemplate's documentation advised to a
DecompressingHttpClient decorator along with Apache's HttpClient in
order to support gzipped responses.

Since this is now deprecated as of Apache HttpClient 4.3+, this commits
update the documentation with HttpClientBuilder.
2014-05-14 18:04:46 +02:00
Arjen Poutsma eb65a37f4b Provide builder for ResponseEntity
This commit introduces a ResponseEntityBuilder, which allows for
building of a ResponseEntity through a fluent API.

Issue: SPR-11752
2014-05-14 08:26:22 -04:00