Commit Graph

5844 Commits

Author SHA1 Message Date
Juergen Hoeller 5b93b14392 DateTimeFormat annotation supports use as a meta-annotation as well 2012-10-31 02:53:23 +01:00
Juergen Hoeller ee50d849a1 Polished "Could not resolve placeholder" error message 2012-10-31 02:53:22 +01:00
Juergen Hoeller 69763fe249 Added test for custom async annotation 2012-10-31 02:53:22 +01:00
Juergen Hoeller 0e0200769d ManagedResource annotation supports placeholders for String attributes
In particular, the specified object name may use a placeholder for its domain part now, allowing for several instances of the MBean to be registered against the same MBeanServer from different applications.

Issue: SPR-8244
2012-10-31 02:53:21 +01:00
Juergen Hoeller 8f8e517c0d Portlet mapping predicate compareTo implementations are transitive now
Also removed unused validateHandler code with dead cachedMappings HashMap.

Issue: SPR-9874
2012-10-31 02:53:20 +01:00
Juergen Hoeller 4ff765446e Added "jtaDataSource" property to JPA LocalContainerEntityManagerFactoryBean (for default units)
Issue: SPR-9883
2012-10-31 02:53:19 +01:00
Juergen Hoeller 88ef3ce51f DispatcherPortlet uses a forward for rendering a view as resource response
Issue: SPR-9876
2012-10-31 02:53:18 +01:00
Phillip Webb 1c7e8cfbf6 Merge pull request #99 from dsyer/SPR-4675
* SPR-4675:
  Throw on advise returning null for primitive type
  Upgrade to Hamcrest 1.3
2012-10-30 16:11:00 -07:00
Dave Syer 3e296974c4 Throw on advise returning null for primitive type
Throw an AopInvocationException when an AOP advisor returns null on
a method that should return a primitive type.

Issue: SPR-4675
2012-10-30 16:09:13 -07:00
Phillip Webb 39682b7d3f Upgrade to Hamcrest 1.3 2012-10-30 15:52:46 -07:00
Phillip Webb 22dfe93f2f Revert ConversionService SPI interface
Remove canBypassConvert() methods from the ConversionService SPI
interface, restoring it to the previous Spring 3.1 incarnation.

Bypassing conversion is now only supported when using a
GenericConversionService.

Issue: SPR-9566
2012-10-30 14:00:12 -07:00
Phillip Webb e9cdb3d24e Polish JavaDoc 2012-10-30 12:07:31 -07:00
Phillip Webb 31331e6ad3 Avoid NPE in ObjectToObjectConverter
Bypass ObjectToObject conversion when source and object types are
identical and protect against a null source object.

Prior to this commit the TypeDescriptor was used to determine if
conversion was necessary.  This caused issues when comparing a
descriptor with annotations to one without.  The updated code
now compares using TypeDescriptor.getType().

The ObjectToObject converter will now no longer attempt to convert
null source objects.

Issue: SPR-9933
2012-10-30 11:25:10 -07:00
Chris Beams 9055a7f810 Merge pull request #156 from philwebb/SPR-9257
# By Phillip Webb
* SPR-9257:
  Resolve Collection element types during conversion
2012-10-30 14:01:16 +01:00
Phillip Webb 5a1f924ac3 Resolve Collection element types during conversion
TypeDescriptor.valueOf now uses GenericCollectionTypeResolver to resolve
Collection and Map element types whereas previously this information was
simply not supported, i.e. null.

Issue: SPR-9257
2012-10-30 14:00:50 +01:00
Chris Beams 99b2f6a081 Merge pull request #163 from philwebb/SPR-9862
# By Phillip Webb
* SPR-9862:
  Allow SpEL reserved words in type package names
2012-10-30 13:39:20 +01:00
Phillip Webb edce2e7bca Allow SpEL reserved words in type package names
Expand the kinds of tokens considered when parsing qualified type names.
This allows previously reserved words (for example 'mod') to be used as
part of a package name.

Issue: SPR-9862
2012-10-30 13:38:37 +01:00
Chris Beams 7c399d795e Merge pull request #167 from philwebb/SPR-9707
# By Chris Beams (1) and Phillip Webb (1)
* SPR-9707:
  Introduce MessageCodeFormatter abstraction
  Provide alternative message code resolver styles
2012-10-30 12:21:37 +01:00
Chris Beams 38bfb2bd89 Introduce MessageCodeFormatter abstraction
This commit refactors changes introduced in 21760a8 as follows:

 - Introduce top-level MessageCodeFormatter interface and
   DefaultMessageCodesResolver#setMessageCodeFormatter property to allow
   for user-defined message code formatting strategies

 - Rename DefaultMessageCodesResolver.Style enum => DMCR.Format

 - Refactor DefaultMessageCodesResolver.Format to implement the new
   MessageCodeFormatter interface

The result is that users have convenient access to common formatting
strategies via the Format enum, while retaining the flexibility to
provide their own custom MessageCodeFormatter implementation if desired.

See DefaultMessageCodesResolverTests#shouldSupport*Format tests for
usage examples.

Issue: SPR-9707
2012-10-30 12:19:45 +01:00
Phillip Webb 21760a8b6b Provide alternative message code resolver styles
Introduce new 'style' property to DefaultMessageCodesResolver allowing
for alternative message styles. Current styles are PREFIX_ERROR_CODE
and POSTFIX_ERROR_CODE. The default style retains existing behavior.

Issue: SPR-9707
2012-10-30 10:09:36 +01:00
Chris Beams a57ff506f2 Merge pull request #132 from philwebb/SPR-9692
# By Phillip Webb (6) and Chris Beams (1)
* SPR-9692:
  Review and polish pull request #132
  Support conversion from Enum Interface
  Test SpEL unconditional argument conversion
  Bypass conversion when possible
  Extend conditional conversion support
  Refactor GenericConversionService
  Additional GenericConversionService Tests
2012-10-30 09:15:57 +01:00
Chris Beams 222eec58cd Review and polish pull request #132
Content:

 - Rename Conditional{Conversion=>Converter}
 - Add @since tags where appropriate
 - Update Apache date headers to read 2002-2012 (not just 2012)
 - Correct minor Javadoc typo

Style:

 - Polish line breaks / whitespace
 - Use wildcard static imports where appropriate

Issue: SPR-9566, SPR-9692, SPR-9928, SPR-9927
2012-10-30 09:14:28 +01:00
Phillip Webb f82c6ed7cc Support conversion from Enum Interface
EnumToStringConverter in now conditional and only matches Enums that
do not implement interfaces that can be converted.

Issue: SPR-9692
2012-10-30 09:14:24 +01:00
Phillip Webb 138957b148 Test SpEL unconditional argument conversion
Issue: SPR-9566
2012-10-30 09:14:18 +01:00
Phillip Webb a27d1a28ff Bypass conversion when possible
Prior to this commit conversion between like types would often result in
a copy of the object. This can be problematic in the case of large byte
arrays and objects that do not have a default constructor.

The ConversionService SPI now includes canBypassConvert methods that can
be used to deduce when conversion is not needed. Several existing
converters have been updated to ensure they only apply when source and
target types differ.

This change introduces new methods to the ConversionService that will
break existing implementations. However, it anticipated that most users
are consuming the ConversionService interface rather then extending it.

Issue: SPR-9566
2012-10-30 09:13:39 +01:00
Phillip Webb f13e3ad72b Extend conditional conversion support
Introduce new ConditionalConversion interface that can be applied to
Converter, ConverterFactory or GenericConverter interfaces to make
them conditional. Prior to this commit the only
ConditionalGenericConverter could be conditional.

Issue: SPR-9928
2012-10-30 09:13:36 +01:00
Phillip Webb 4dc289592d Refactor GenericConversionService
Refactor internal workings of GenericConversionService in order to
better support future enhancements. This commit should not affect
existing behavior.

Issue: SPR-9927
2012-10-30 09:13:22 +01:00
Phillip Webb 9bfe675761 Additional GenericConversionService Tests 2012-10-30 09:13:18 +01:00
Rossen Stoyanchev d8469d118b Fix issue with extracting matrix variables
The servlet spec recommends removing path parameters from the
contextPath, servletPath, and pathInfo but not from the requestURI.
This poses a challenge for the UrlPathHelper, which determines the
lookup path by comparing the above.

This change introduces a method that matches the requestURI to the
contextPath and servletPath ignoring path parameters (i.e. matrix
variables) for comparison purposes while also preserving them in the
resulting lookup path.
2012-10-29 19:09:00 -04:00
Rossen Stoyanchev 826057bcde Expose convenience method in MVC Java config
The new method allows modifying or overriding the
ConfigurableWebBindingInitializer instance used for data binder
initialization.

Issue: SPR-8984
2012-10-29 05:56:30 -04:00
Phillip Webb 3a1dd20de9 Upgrade to Gradle 1.2
Issue: SPR-9790
2012-10-28 12:11:43 -07:00
Phillip Webb 7fd18298d1 Update changelog 2012-10-28 12:01:39 -07:00
Sam Brannen 404ea7adcf Polish Javadoc in ContextLoaderUtils 2012-10-28 19:15:10 +01:00
Rossen Stoyanchev 5d04ef4c4a Support selective filtering of error dispatches
OncePerRequestFilter now allows sub-classes to choose whether they
should ever get involved in processing an error dispatch.

Issue: SPR-9895
2012-10-28 12:47:00 -04:00
Rossen Stoyanchev d952da2338 Polish (minor) async support in filters
Issue: SPR-9895
2012-10-28 12:10:38 -04:00
Rossen Stoyanchev f7ec738857 Sync up MockAsyncContext implementations in src/test 2012-10-28 12:10:38 -04:00
Sam Brannen d4e7d19237 Consistent class loading in ContextLoaderUtils 2012-10-28 16:23:49 +01:00
Sam Brannen c79c4c6e25 Fix typos and suppress warnings in JdbcTemplate 2012-10-28 15:43:16 +01:00
Phillip Webb e4158f91a4 Merge pull request #153 from gid79/SPR-9812
* SPR-9812:
  Allow 'arg-type' matches against element body
  Polish whitespace
2012-10-27 19:50:12 -07:00
Gareth Davis 0709c033a0 Allow 'arg-type' matches against element body
Allow the body of 'arg-type' XML elements to be used as an alternative to
'match' attribute when defining a 'replace-method' in XML configuration.

This change has been introduced primarily to support the samples printed
in the Apress 'Pro Spring' book.

Issue: SPR-9812
2012-10-27 19:49:54 -07:00
Phillip Webb 376eeed8b1 Polish whitespace 2012-10-27 19:49:54 -07:00
Sam Brannen 461d99af29 Fix package cycles in spring-test
Code introduced in conjunction with SPR-5243 introduced package cycles
between the ~.test.context and ~.test.context.web packages. This was
caused by the fact that ContextLoaderUtils worked directly with the
@WebAppConfiguration and WebMergedContextConfiguration types.

To address this, the following methods have been introduced in
ContextLoaderUtils. These methods use reflection to circumvent hard
dependencies on the @WebAppConfiguration and
WebMergedContextConfiguration types.

 - loadWebAppConfigurationClass()
 - buildWebMergedContextConfiguration()

Issue: SPR-9924
2012-10-28 00:13:01 +02:00
Sam Brannen 33d5b011d3 Reduce code duplication in ContextLoaderUtils
Prior to this commit, the following two methods in ContextLoaderUtils
contained almost identical loops for traversing the test class
hierarchy:

 - resolveContextLoaderClass(Class<?>, String)
 - resolveContextConfigurationAttributes(Class<?>)

With this commit, resolveContextLoaderClass() no longer traverses the
class hierarchy. Instead, it now works directly with the resolved list
of ContextConfigurationAttributes, thereby removing code duplication.

Issue: SPR-9918
2012-10-27 22:29:55 +02:00
Sam Brannen 397d20b55a Update changelog
Issue: SPR-9593
2012-10-27 21:10:15 +02:00
Sam Brannen 90c5f226b6 Fix package cycles in spring-test
Code introduced in conjunction with SPR-5243 introduced package cycles
between the ~.test.context.web and ~.test.context.support packages. This
was caused by the fact that ServletTestExecutionListener extended
AbstractTestExecutionListener.

To address this, ServletTestExecutionListener now implements
TestExecutionListener directly.

Issue: SPR-9924
2012-10-27 20:42:06 +02:00
Sam Brannen acc8364539 Update changelog
Issue: SPR-9724
2012-10-27 18:29:52 +02:00
Sam Brannen 591aa01741 Configurable locales in MockHttpServletRequest
Prior to this commit the MockHttpServletRequest constructor chain set
the preferred local to Locale.ENGLISH. Furthermore, it was possible to
add additional preferred locales "in front" of ENGLISH; however, it was
not possible to delete ENGLISH from the list of preferred locales.

This commit documents the fact that ENGLISH is the default preferred
locale and makes it possible to set the list of preferred locales via a
new setPreferredLocales(List<Locale> locales) method.

Issue: SPR-9724
2012-10-27 18:13:13 +02:00
Sam Brannen 7d9c823a15 Delete unused imports 2012-10-27 17:32:51 +02:00
Rossen Stoyanchev fe77c3d5fe Fix failing test 2012-10-26 22:01:35 -04:00
Rossen Stoyanchev e14ba9dec3 Add config options for MVC async interceptors
The MVC namespace and the MVC Java config now allow configuring
CallableProcessingInterceptor and DeferredResultProcessingInterceptor
instances.

Issue: SPR-9914
2012-10-26 21:29:54 -04:00