Commit Graph

4026 Commits

Author SHA1 Message Date
Costin Leau 86a499b786 revise cache API
+ update failing AJ test

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4318 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-17 17:35:01 +00:00
Costin Leau e4ed1f1530 revise cache API
+ update failing test

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4317 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-17 17:09:49 +00:00
Costin Leau 328fdc5c04 revise cache API
+ add missing files (remember to check "show unversioned files")

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4316 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-17 16:58:15 +00:00
Costin Leau b22e4dc15a revise cache API
- eliminate unneeded methods
+ introduced value wrapper (name still to be decided) to avoid cache race conditions
+ improved name consistency

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4315 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-17 16:50:00 +00:00
Rossen Stoyanchev 76abf77077 Use request attribute to check producible media types when writing to the response body
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4314 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-17 13:02:48 +00:00
Arjen Poutsma 22f2c2bde0 minor fix.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4313 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-17 12:22:21 +00:00
Arjen Poutsma 4cebd2ef0b Only respect RequestMappingInfos that have a pattern match in handleNoMatch
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4312 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-17 10:07:36 +00:00
Arjen Poutsma 7b6c98ac9b SPR-7353 - @ResponseBody and returned HttpEntity now respect @RequestMapping.produces()
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4311 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-17 09:45:57 +00:00
Rossen Stoyanchev 89b5be3754 SPR-2692 Update mvc chapter with URI template support in redirect: view names
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4310 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-16 13:24:42 +00:00
Oliver Gierke 11383f27fb SPR-8336 - Fixed broken test case.
Converted the test to JUnit 4.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4309 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-14 06:44:51 +00:00
Oliver Gierke 6f41d8c68d SPR-8336 - Added constructor to AnnotationTypeFilter to allow matching interfaces as well.
Reviewed by Chris.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4308 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-14 06:22:44 +00:00
Rossen Stoyanchev f4bfd5766a SPR-6996 Add mvc:interceptor bean references
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4307 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-13 18:06:55 +00:00
Costin Leau 8fb6790f7d SPR-8334
+ commit missing configs

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4306 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-13 16:09:33 +00:00
Costin Leau b6b8e8ecdc SPR-8334
+ commit missing configs

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4305 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-13 15:59:22 +00:00
Rossen Stoyanchev 461c3dd1a6 SPR-8289 Ensure BeanNameUrlHandlerMapping and default HandlerAdapters are never 'turned off' through the MVC namespaces
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4304 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-13 15:46:37 +00:00
Costin Leau 90a0504c5c SPR-8256
+ fix small doc typo

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4303 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-13 15:40:12 +00:00
Costin Leau f1eaefb4fd SPR-
+ remove duplicate class

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4302 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-13 15:37:10 +00:00
Arjen Poutsma 3f9a857d4c SPR-7353 - Added equivalent of JAX-RS @Produces to Spring MVC
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4301 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-13 09:43:45 +00:00
Chris Beams 31bc941b28 Document @Autowired and @Value limitations
@Autowired, @Value and other annotations cannot be applied within
Spring Bean(Factory)PostProcessor types, because they themselves
are processed using BeanPostProcessors.  Javadoc and reference docs
have been updated to reflect.

Issue: SPR-4935, SPR-8213

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4300 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-13 03:41:29 +00:00
Chris Beams 4e1de28861 Remove "@BeanAge" from reference documentation
Issue: SPR-8327

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4299 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-13 03:40:26 +00:00
Andy Clement 2a04e8c444 SPR-8211: property accessor ordering correction and removal of unnecessary duplicates
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4298 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-12 16:40:44 +00:00
Rossen Stoyanchev 416c282609 Add method to allow further validation of request mapping infos at startup + other minor javadoc updates.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4297 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-12 15:03:36 +00:00
Chris Beams 26a0e223a4 Fix @Autowired+@PostConstruct+@Configuration issue
A subtle issue existed with the way we relied on isCurrentlyInCreation
to determine whether a @Bean method is being called by the container
or by user code.  This worked in most cases, but in the particular
scenario laid out by SPR-8080, this approach was no longer sufficient.

This change introduces a ThreadLocal that contains the factory method
currently being invoked by the container, such that enhanced @Bean
methods can check against it to see if they are being called by the
container or not.  If so, that is the cue that the user-defined @Bean
method implementation should be invoked in order to actually create
the bean for the first time.  If not, then the cached instance of
the already-created bean should be looked up and returned.

See ConfigurationClassPostConstructAndAutowiringTests for
reproduction cases and more detail.

Issue: SPR-8080

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4296 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-12 12:28:13 +00:00
Chris Beams 2b0b4a58cb Refine ignored @PropertySource log warning
If the enclosing environment does not implement ConfigurableEnvironment,
then @PropertySource annotations are ignored because there is no way to
add them to the Environment. Now checking first to see if there are any
@PropertySource annotations present before issuing the warning.

Issue: SPR-8314

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4295 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-12 12:27:14 +00:00
Arjen Poutsma 6d06f137cf Javadoc
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4294 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-12 09:00:39 +00:00
Andy Clement 96160448ac SFW-8228
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4293 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-11 23:41:30 +00:00
Andy Clement c399e1e033 SFW-8224: distance can be used when computing method matches in ReflectiveMethodResolver
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4292 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-11 21:44:24 +00:00
Sam Brannen 9ce25bc5e4 polishing
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4291 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-11 20:09:08 +00:00
Rossen Stoyanchev 4e0594afaf Rename EnableMvcConfiguration->EnableWebMvc, refine method names in WebMvcConfigurer, fix issue with MappedInterceptors
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4290 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-11 18:02:07 +00:00
Chris Beams b05cef9574 Introduce @PropertySource
Allows a convenient mechanism for contributing a PropertySource to the
enclosing Spring Environment. See @PropertySource Javadoc for
complete details and PropertySourceAnnotationTests for examples.

Issue: SPR-8314

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4289 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-11 13:28:33 +00:00
Chris Beams f9783127e9 Introduce ResourcePropertySource
Allows convenient creation of a Properties-based PropertySource from a
Spring Resource object or resource location string such as
"classpath:com/myco/app.properties" or "file:/path/to/file.properties"

Issue: SPR-8328

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4288 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-11 13:28:05 +00:00
Arjen Poutsma f01ba3249f Make HTTP methods a RequestCondition
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4287 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-11 10:38:30 +00:00
Chris Beams 0b64290194 Add MockEnvironment to .integration-tests
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4286 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-11 07:51:32 +00:00
Chris Beams 3f7d5120c9 Support 'required properties' precondition
Users may now call #setRequiredProperties(String...) against the
Environment (via its ConfigurablePropertyResolver interface) in order
to indicate which properties must be present.

Environment#validateRequiredProperties() is invoked by
AbstractApplicationContext during the refresh() lifecycle to perform
the actual check and a MissingRequiredPropertiesException is thrown
if the precondition is not satisfied.

Issue: SPR-8323

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4285 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-11 07:36:04 +00:00
Chris Beams 26e6c9f1df Pull up default getProperty variants to base class
Issue: SPR-8322

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4284 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-11 07:35:16 +00:00
Chris Beams 11cf5f0d3b Add default-value getProperty convenience variants
Issue: SPR-8322

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4283 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-11 06:09:06 +00:00
Chris Beams 653773574e Polish @Configuration Javadoc
Add note that nested @Configuration classes must be static.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4282 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-11 06:08:40 +00:00
Chris Beams 4c746017c5 Allow static modifier on @Bean methods
Declaring @Bean methods as 'static' is now permitted, whereas previously
it raised an exception at @Configuration class validation time.

A static @Bean method can be called by the container without requiring
the instantiation of its declaring @Configuration class. This is
particularly useful when dealing with BeanFactoryPostProcessor beans,
as they can interfere with the standard post-processing lifecycle
necessary to handle @Autowired, @Inject, @Value, @PostConstruct and
other annotations.

static @Bean methods cannot recieve CGLIB enhancement for scoping and
AOP concerns. This is acceptable in BFPP cases as they rarely if ever
need it, and should not in typical cases ever be called by another
@Bean method.  Once invoked by the container, the resulting bean will
be cached as usual, but multiple invocations of the static @Bean method
will result in creation of multiple instances of the bean.

static @Bean methods may not, for obvious reasons, refer to normal
instance @Bean methods, but again this is not likely a concern for BFPP
types. In the rare case that they do need a bean reference, parameter
injection into the static @Bean method is technically an option, but
should be avoided as it will potentially cause premature instantiation
of more beans that the user may have intended.

Note particularly that a WARN-level log message is now issued for any
non-static @Bean method with a return type assignable to BFPP.  This
serves as a strong recommendation to users that they always mark BFPP
@Bean methods as static.

See @Bean Javadoc for complete details.

Issue: SPR-8257, SPR-8269

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4281 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-10 11:55:41 +00:00
Chris Beams ae0dc34f29 Test interaction of @ComponentScan and @Import
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4280 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-10 11:54:37 +00:00
Arjen Poutsma 5d10187239 SPR-7354 - Added equivalent of JAX-RS @Consumes to Spring MVC
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4279 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-10 09:23:00 +00:00
Costin Leau 32121f3664 SPR-8256
+ doc updates

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4278 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-09 17:40:23 +00:00
Arjen Poutsma c05ee1467a Made comparators public, as they are needed elsewhere.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4277 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-09 11:20:49 +00:00
Rossen Stoyanchev da3ad5623b Refine HandlerMethod registration to allow detection by handler instance as well as by bean name
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4276 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-08 19:31:29 +00:00
Chris Beams 11c31085fe Allow recursive use of @ComponentScan
Prior to this change, @ComponentScan annotations were only processed at
the first level of depth.  Now, the set of bean definitions resulting
from each declaration of @ComponentScan is checked for configuration
classes that declare @ComponentScan, and recursion is performed as
necessary.

Cycles between @ComponentScan declarations are detected as well. See
CircularComponentScanException.

Issue: SPR-8307

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4275 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-08 13:49:35 +00:00
Chris Beams b5d18feb55 Polish @EnableScheduling Javadoc
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4274 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-08 13:48:02 +00:00
Chris Beams 4f38c21f76 Rename AsyncConfigurer#get{+Async}Executor
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4273 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-07 09:32:03 +00:00
Chris Beams f0b8bbc04b Polish @EnableScheduling Javadoc
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4272 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-07 09:31:13 +00:00
Chris Beams fc3ccd1052 Expose return-value-handlers in mvc namespace
Mirroring the MvcConfigurer#addCustomReturnValueHandlers callback which
allows for providing a list of HandlerMethodReturnValueHandler types

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4271 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-06 19:13:44 +00:00
Chris Beams 9e0b7303b4 Rename RequestMapping types for concision
Remove 'Method' from RequestMappingHandlerMethodMapping and
RequestMappingHandlerMethodAdapter

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4270 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-06 19:13:05 +00:00
Chris Beams 210e278ce0 Rename DataBinderFactory subtypes for concision
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4269 50f2f4bb-b051-0410-bef5-90022cba6387
2011-05-06 19:12:14 +00:00