Commit Graph

5024 Commits

Author SHA1 Message Date
Juergen Hoeller 3a62aa053e fixed pointcut for type-level annotation to only apply to public methods (SPR-8890) 2011-12-06 21:03:57 +00:00
Juergen Hoeller a347e4d3c2 optimized AnnotationTransactionAspect pointcut to avoid runtime checks (SPR-8890) 2011-12-06 20:48:49 +00:00
Juergen Hoeller d050a472a2 added "mappingResources" property to LocalContainerEntityManagerFactoryBean (pointing to orm.xml; SPR-8440) 2011-12-06 18:18:57 +00:00
Costin Leau 1a2a3dd02a + update AJ tests 2011-12-06 14:13:29 +00:00
Costin Leau cb3524ff30 + fix failing cache tests
+ renamed afterInvocation to beforeInvocation (and changed the docs and tests accordingly)
2011-12-06 14:05:33 +00:00
Costin Leau 735ba9dcde SPR-8082
+ support generic discovery of multiple annotations of the same type (such as stereotypes)
2011-12-06 13:32:25 +00:00
Chris Beams 5fe0804017 Remove references to -with-dependencies distribution
Issue: SPR-7788, SPR-6575
2011-12-06 13:19:35 +00:00
Chris Beams 28ff473091 Allow multiple @Filter 'value' args for concision
Prior to this change, to specify two or more annotation include/exclude
filters, one would declare @ComponentScan as follows:

    @ComponentScan(basePackages="example.scannable",
       useDefaultFilters=false,
       includeFilters={
           @Filter(MyStereotype.class),
           @Filter(MyComponent.class)
       })

This was because @Filter's 'value' attribute accepted exactly one
argument.

Now, any given @Filter may accept one or more value arguments, allowing
for more concise @ComponentScan declarations:

    @ComponentScan(basePackages="example.scannable",
       useDefaultFilters=false,
       includeFilters=@Filter({MyStereotype.class, MyComponent.class}))

Supplying multiple arguments in this way assumes that they are the same
type of filter, e.g. ANNOTATION, ASSIGNABLE_TYPE, or CUSTOM. To declare
multiple *different* types of filters, multiple @Filter annotations are
still required, e.g.:

    @ComponentScan(
        includeFilters={
            @Filter(type=ANNOTATION, value=MyStereotype.class),
            @Filter(type=ASSIGNABLE_TYPE, value={Foo.class, Bar.class})
        })

Note that specifying zero arguments, e.g. @Filter({}) is nonsensical; it
will have no effect on component scanning, but does not raise an error.

Issue: SPR-8881
2011-12-06 12:18:10 +00:00
Chris Beams df7bda5637 Constrain targets for @Filter declaration
For clarity, add @Target({}) to definition of @Filter, constraining it
to complex annotation composition only; i.e. it cannot be placed on
any element, only within annotations, e.g.

    @ComponentScan(includeFilters=@Filter(...))

is legal, while

    @Filter
    public class MyType { }

is not.

Also, widen @Retention from SOURCE to RUNTIME, even though it is not
technically necessary, as all parsing of @Filter annotations happens via
ASM, i.e. at the source level.  This change is made primarily for
consistency (@ComponentScan's Retention is RUNTIME) and in avoidance of
potential confusion or surprise on the part of those casually browsing
the code.
2011-12-06 12:17:54 +00:00
Chris Beams c2c224958d Polish WebApplicationInitializer Javadoc
Issue: SPR-8897
2011-12-06 12:17:42 +00:00
Juergen Hoeller aedccec67e restored SpringValidatorAdapter's ability to handle bean constraints with property paths (SPR-8895) 2011-12-05 22:37:55 +00:00
Juergen Hoeller 27471e0555 added support for JPA 2.1 unwrap method on EntityManagerFactory interface 2011-12-05 21:34:44 +00:00
Juergen Hoeller 66b4eb16a5 Portlet MVC annotation mapping allows for distributing action names across controllers (SPR-7685) 2011-12-05 21:20:27 +00:00
Juergen Hoeller bea5016e53 fixed validation test failures 2011-12-03 17:03:33 +00:00
Juergen Hoeller 84be348cb0 log or rethrow original ConversionFailedException as appropriate 2011-12-03 15:57:19 +00:00
Juergen Hoeller 207b2315ed added validation hints support to ValidationUtils as well (SPR-7847) 2011-12-03 15:54:52 +00:00
Juergen Hoeller 1a2bbe5c4d consistent specification of standard meta-annotations 2011-12-03 15:47:10 +00:00
Juergen Hoeller 00133179df added SmartValidator interface with general support for validation hints; added custom @Valid annotation with support for JSR-303 validation groups; JSR-303 SpringValidatorAdapter and MVC data binding provide support for validation groups (SPR-6373) 2011-12-03 15:46:31 +00:00
Juergen Hoeller 49a2aaf023 added SmartValidator interface with general support for validation hints; added custom @Valid annotation with support for JSR-303 validation groups; JSR-303 SpringValidatorAdapter and MVC data binding provide support for validation groups (SPR-6373) 2011-12-03 15:44:33 +00:00
Rossen Stoyanchev 4bfcb79ae3 SPR-8892 Add String constants to MediaType. 2011-12-02 18:58:41 +00:00
Juergen Hoeller 21f61e3680 Portlet session mutex uses global session attribute to be shared among all portlets in the session (SPR-8888) 2011-12-02 12:03:35 +00:00
Arjen Poutsma 53cb529162 SPR-8809 - RestTemplate headers not sent when bufferRequestBody is false 2011-12-02 11:29:47 +00:00
Rossen Stoyanchev 9f98f77c3e SPR-8863 Add RequestContext.getPathToServlet() method.
This method allows a view to access the combined context path and
servlet mapping path for prefixing URLs without having to specify
the literal part of a servlet mapping such as "/main/*") 
explicitly everywhere. For example:

${requestContext.pathToServlet}/css/main.css
2011-12-01 22:56:51 +00:00
Juergen Hoeller 0ef3beb462 prepared for 3.1 GA 2011-12-01 18:52:12 +00:00
Juergen Hoeller 33b53b7cca alignment with 3.0.7 backports (SPR-8674) 2011-12-01 18:51:36 +00:00
Juergen Hoeller 71e0a506b9 polishing 2011-12-01 15:12:26 +00:00
Juergen Hoeller 45a0ae3fb9 polishing 2011-12-01 15:11:32 +00:00
Rossen Stoyanchev ca4eafd4dd SPR-8808 Remove excludeFilter from javadoc examples in @EnableWebMvc. 2011-12-01 14:35:36 +00:00
Juergen Hoeller f75e832e7c polishing 2011-12-01 13:34:12 +00:00
Juergen Hoeller dc41daa3db renamed 'isJava6VisibilityBridgeMethodPair' to 'isVisibilityBridgeMethodPair' (SPR-8660) 2011-12-01 13:14:06 +00:00
Juergen Hoeller 2b122816af fixed QuartzJobBean to work with Quartz 2.0/2.1 as well (SPR-8889) 2011-12-01 12:56:47 +00:00
Juergen Hoeller ffa4784628 polishing (SPR-8005) 2011-12-01 12:53:47 +00:00
Costin Leau 0a611aa776 SPR-8082
+ fix internal cache causing the multiple annotations key/conditions to overlap
2011-11-30 15:21:09 +00:00
Arjen Poutsma 91c14bd1fe SPR-8809 - RestTemplate headers not sent when bufferRequestBody is false 2011-11-30 11:07:38 +00:00
Sam Brannen 951514a576 removed unused imports 2011-11-29 21:29:15 +00:00
Juergen Hoeller d6d169ac56 resolved package dependency tangles 2011-11-29 01:16:09 +00:00
Juergen Hoeller 686ae8f7b3 final preparations for 3.1 RC2 release 2011-11-28 22:57:33 +00:00
Juergen Hoeller 9f3e333084 fixed NotificationListenerBean assertion in constructor (SPR-8091) 2011-11-28 22:47:48 +00:00
Juergen Hoeller c2eafdb2fb AbstractCachingViewResolver caches unresolved view names by default ("cacheUnresolved"=true; SPR-8173) 2011-11-28 22:46:53 +00:00
Juergen Hoeller 1bb6d29be2 AbstractCachingViewResolver caches unresolved view names by default ("cacheUnresolved"=true; SPR-8173) 2011-11-28 22:34:29 +00:00
Chris Beams 6991cd9cdf Allow @Configuration classes to self-@ComponentScan
Prior to this change, a @Configuration classes that @ComponentScan
themselves would result in a ConflictingBeanDefinitionException.

For example:

    package com.foo.config;

    @Configuration
    @ComponentScan("com.foo");
    public class AppConfig {
        // ...
    }

This resulted in a ConflictingBeanDefinitionException that users have
typically worked around in the following fashion:

    package com.foo.config;

    @Configuration
    @ComponentScan(basePackages="com.foo",
        excludeFilters=@Filter(value=ANNOTATION_TYPE, type=Configuration.class);
    public class AppConfig {
        // ...
    }

This is obviously more verbose and cumbersome than would be desirable,
and furthermore potentially too constraining as it prohibits the ability
to include other legitimate @Configuration classes via scanning.

The exception was being thrown because of a logic problem in
ClassPathBeanDefinitionScanner.  The bean definition for AppConfig gets
registered once by the user (e.g. when constructing an
AnnotationConfigApplicationContext), then again when performing the
component scan for 'com.foo'. Prior to this change,
ClassPathBeanDefinitionScanner's #isCompatible returned false if the new
bean definition was anything other than an AnnotatedBeanDefinition.  The
intention of this check is really to see whether the new bean definition
is a *scanned* bean definition, i.e. the result of a component-scanning
operation.  If so, then it becomes safe to assume that the original bean
definition is the one that should be kept, as it is the one explicitly
registered by the user.

Therefore, the fix is as simple as narrowing the instanceof check from
AnnotatedBeanDefinition to its ScannedGenericBeanDefinition subtype.

Note that this commit partially reverts changes introduced in SPR-8307
that explicitly caught ConflictingBeanDefinitionExceptions when
processing recursive @ComponentScan definitions, and rethrew as a
"CircularComponentScanException.  With the changes in this commit,
such CBDEs will no longer occur, obviating the need for this check and
for this custom exception type altogether.

Issue: SPR-8808, SPR-8307
2011-11-28 21:35:38 +00:00
Juergen Hoeller 450c75337f fixed getAsText javadoc (SPR-7890) 2011-11-28 21:14:40 +00:00
Juergen Hoeller fa9a7b18c6 refined Resource "exists()" check for HTTP URLs to always return false for 404 status (SPR-7881) 2011-11-28 21:11:57 +00:00
Juergen Hoeller 2cb287a01b JPA EntityManagerFactoryUtils silently ignores IllegalArgumentExceptions from setHint calls (SPR-7947) 2011-11-28 20:54:37 +00:00
Juergen Hoeller e6272312a8 allow "packagesToScan" to be optional on LocalSessionFactoryBean (SPR-8812) 2011-11-28 20:48:21 +00:00
Juergen Hoeller b391629de1 LinkedCaseInsensitiveMap overrides putAll method as well (for IBM JDK 1.6 compatibility; SPR-7969) 2011-11-28 20:48:02 +00:00
Juergen Hoeller e7d1b5e0ee JDO PersistenceManager synchronization performs close attempt after completion (if necessary; SPR-8846) 2011-11-28 19:38:28 +00:00
Juergen Hoeller c9b36fb4e6 TransactionSynchronizationManager eagerly cleans up void ResourceHolders on any access (SPR-8844, SPR-8845) 2011-11-28 18:54:11 +00:00
Rossen Stoyanchev a9a068e678 SPR-8867 Fix issue with Content-Length header and UTF-8 charset.
The AbstractHttpMessageConverter was using the requested Content-Type
rather than the actual response Content-Type to determine the length
of the content. This can lead to a problem when a controller returns
a ResponseEntity with a Content-Type header that ignores (overrides)
the requested Content-Type. The fix ensures that actual response 
Content-Type is the one used both to write to the response and to 
determine the length of the content.
2011-11-28 18:42:57 +00:00
Juergen Hoeller aa7fcb5431 polishing 2011-11-28 18:38:26 +00:00