Commit Graph

6723 Commits

Author SHA1 Message Date
Juergen Hoeller 25e29b851d GenericTypeResolver defensively calls Class.getGenericSuperclass() and consistently uses Class<?>
Issue: SPR-10559
2013-05-14 16:02:52 +02:00
Rob Winch 23737a4516 Update the README to use JDK1.8 b88 2013-05-14 08:54:25 -05:00
Rob Winch 9468548116 Add @Override to remaining source files
Issue: SPR-10130
2013-05-13 17:04:56 -05:00
Rossen Stoyanchev 30db112d37 Close InputStream in ResourceHttpMessageConverter
Spring 3.2.2 introduced a change to avoid closing the response stream
in HttpMessageConverters (SPR-10095). However, the InputStream of
resources being written, for example as part of a multi-part request
should be closed. This change ensures that.

Issue: SPR-10460
2013-05-10 17:31:11 -04:00
Sam Brannen 6fa493908b Hoellereasymock --> Hoeller 2013-05-10 22:13:23 +02:00
Juergen Hoeller 1f0f46fb06 ServletContextResourcePatternResolver uses encoded jar file location for UrlResource
Adding overloaded constructors for URI specification to UrlResource, as a convenience.

Issue: SPR-10471
2013-05-10 22:11:40 +02:00
Rossen Stoyanchev 0634555424 Delay check if pattern ends with slash
This is a minor fix with no actual impact.

Issue: SPR-10504
2013-05-10 12:47:44 -04:00
Rossen Stoyanchev e39fe1822d Allow treating empty @RequestParam as missing value
If type conversion turns an empty request parameter value (i.e. "") to
null, we should treat it as a missing value. By default the
ConversionService doesn't change empty strings and therefore one must
explicitly convert them to null for example by registering a
StringTrimmerEditor with emptyAsNull=true.

Issue: SPR-10402
2013-05-10 12:31:00 -04:00
Rossen Stoyanchev c0cacfcd68 Add servletRelativeAction form tag attribute
A recent change in FormTag to prepend the context and servlet paths if
not present, causes issues when used in portlet applications.
This change introduces a servletRelativeAction form tag attribute that
must be used for the context and servlet paths to be prepended.

Issue: SPR-10382
2013-05-10 11:56:50 -04:00
Rossen Stoyanchev aaded7e30b Improve default content type selection
Previously ContentNegotiationManager continued with the next
ContentNegotiationStrategy only if the current one returned an empty
list. Now it also does that if the current ContentNegotiationStrategy
returns "*/*". Since the absence of an Accept header and "*/*" have
the same meaning, this allows a default content type to be used in
either case.

Issue: SPR-10513
2013-05-10 11:10:15 -04:00
Rossen Stoyanchev 78fcd28389 Invoke global, then local @InitBinder/@ModelAttribute
@InitBinder and @ModelAttribute methods in @ControllerAdvice classes
are now invoked first, allowing any such methods in the @Controller
class to override them.

Issue: SPR-10419
2013-05-10 10:42:42 -04:00
Juergen Hoeller 640555194b Introduced assertions for bean accessor delegation in AbstractApplicationContext
Issue: SPR-10307
2013-05-10 01:32:00 +02:00
Phillip Webb 30b21a987e Make @Configuration classes thread-safe
Refactor ConfigurationClassEnhancer so that BeanFactory instances are
not held against CGLIB Callback objects. Enhanced @Configuration classes
now use the BeanFactoryAware interface in order to obtain a BeanFactory.

This change has the additional benefit that a static final field can
now be used to hold all Callback instances.

Issue: SPR-10307
2013-05-09 15:05:40 -07:00
Phillip Webb 8b904102ff Update ...DirtiesContextTests to get beans early
Change ContextHierarchyDirtiesContextTests to obtain beans whilst the
ApplicationContext is still open, rather than trying to obtain them
after the context has been closed.
2013-05-09 14:57:16 -07:00
Phillip Webb 3126a4cf46 Merge branch 'SPR-10534'
* SPR-10534:
  Add support for DeferredImportSelector
  Support for @Conditional configuration
  Extend AnnotationMetadata and MethodMetadata
2013-05-08 19:56:43 -07:00
Phillip Webb 7c7fdb0736 Add support for DeferredImportSelector
Add DeferredImportSelector interface that can be used to select imports
after all @Configuration beans have been processed.
2013-05-08 19:41:20 -07:00
Phillip Webb b257253a2b Support for @Conditional configuration
Introduce new @Conditional annotation that can be used to filter
which @Configuration classes or methods are loaded. @Conditional
can be used directly or as a meta-annotation. Condition implementations
are provided via the 'Condition' interface and are free to filter based
on any criteria available at the time that they run. The
ConditionalContext provides access to the BeanDefinitionRegistry,
Environment and ConfigurableListableBeanFactory along with a
ResourceLoader and ClassLoader.

The existing @Profile annotation has been refactored as a @Conditional
with the added benefit that it can now be used as a method level
annotation.
2013-05-08 19:41:20 -07:00
Phillip Webb 8e445f3a21 Extend AnnotationMetadata and MethodMetadata
Update AnnotationMetadata and MethodMetadata to extend from a new
AnnotatedTypeMetadata base interface containing the methods that are
common to both. Also introduce new getAllAnnotationAttributes methods
providing MultiValueMap access to both annotation and meta-annotation
attributes.

Existing classreading and standard implementations have been
refactored to support the new interface.
2013-05-08 19:41:20 -07:00
Phillip Webb eb1776e79d Allow access to applied property sources
Add PropertySourcesPlaceholderConfigurer.getAppliedPropertySources() to
allow access to the PropertySources that were actually applied.

Issue: SPR-10545
2013-05-08 19:40:57 -07:00
Phillip Webb 0652febe34 Make Make ClassPathContextResource protected
Allow ClassPathContextResource to be accessed by subclasses of
DefaultResourceLoader.

Issue: SPR-10544
2013-05-08 15:16:43 -07:00
Phillip Webb 13e460827e Fix external Javadoc references. 2013-05-08 15:16:18 -07:00
Phillip Webb e9a2e688cb Allow late binding ServletContextAwareProcessor
Update ServletContextAwareProcessor to allow subclasses to support late
binding of the ServletConfig and/or ServletContext. Allows for the
post-processor to be registered before the servlet environment has been
initialized.

Issue: SPR-10381
2013-05-08 15:15:08 -07:00
Phillip Webb 19187fd365 Allow FrameworkServlet to be used as a bean
Change FrameworkServlet so that it can also be used as a bean within an
existing ApplicationContext. Primarily added to support use with
embedded servlet containers where Spring bootstraps the servlet
container, rather than the servlet container bootstrapping Spring.

Issue: SPR-10381
2013-05-08 15:14:58 -07:00
Chris Beams eaf8115d59 Update README.md
- Remove references to python and .net variants
 - Update prereqs for building from source to JDK 1.8
2013-05-08 10:27:13 +03:00
Juergen Hoeller cd1c584243 Reordered spring-websocket module descriptor 2013-05-08 00:02:14 +02:00
Juergen Hoeller ad886503f1 Revised ReflectiveMethodResolver to properly handle any kind of List returned from a MethodFilter
Issue: SPR-10392
2013-05-07 21:56:17 +02:00
Juergen Hoeller 35847ad003 Fixed MockMvc example code
Issue: SPR-10389
2013-05-07 21:38:45 +02:00
Juergen Hoeller 2a44228b98 Consistent use of <pre class="code">
Issue: SPR-8108
2013-05-07 21:31:26 +02:00
Juergen Hoeller 1ca943c681 Fixed javadoc warnings
Issue: SPR-10373
2013-05-07 21:26:01 +02:00
Juergen Hoeller fcb0cf27d7 MappingJackson(2)HttpMessageConverter alignment 2013-05-07 18:11:55 +02:00
Juergen Hoeller a0c377b91b MappingJackson(2)MessageConverter needs to use bean ClassLoader 2013-05-07 18:11:54 +02:00
Juergen Hoeller 527776cde4 Removed JDK 8 workaround (not necessary anymore with build 88) 2013-05-07 18:11:53 +02:00
Juergen Hoeller 2c3a8a5309 Removed parsing support for the 'singleton' attribute in an XML bean definition
Following the introduction of spring-beans-4.0.xsd and the corresponding removal of the pre-2.0 spring-beans.dtd.

Issue: SPR-10437
2013-05-07 18:11:52 +02:00
Juergen Hoeller 0fc5a5d912 Introduced 4.0 versions of all XML configuration schemas
Removed spring-beans.dtd (the 1.x variant) and spring-oxm-1.5.xsd (pre-Spring-Framework variant), in order to raise the backwards compatibility limit a little bit at least. We'll keep supporting the 2.0 and 2.5 xsd versions for the time being, as well as spring-beans-2.0.dtd.

Removed the ref 'local' attribute in spring-beans-4.0.xsd since 'local' lost its differentiating role to a regular bean ref back in the 3.1 days when we started allowing for the same bean id to reappear in a different beans section of the same configuration file (with a different profile).

Issue: SPR-10437
2013-05-07 18:11:51 +02:00
Phillip Webb e1c25ff1a3 Workaround jasper report test fail on OSX
Add temporary Assume.canLoadNativeDirFonts() method allowing failing
jasper report tests to be bypassed on OSX.

This should be revisited when JDK 8 is released.

Issue: SPR-10537
2013-05-07 08:23:46 -07:00
Rossen Stoyanchev 043aafed86 Fix build version 2013-05-07 08:19:03 -04:00
Phillip Webb 71f6da673a Consider @Import classes as lite @Configuration
Allow classes that are annotated with @Import to be considered as 'lite'
@Configuration candidates. Allows the AnnotationConfigApplicationContext
to directly register @Import beans even if they are not @Components.

Issue: SPR-10533
2013-05-06 16:00:59 -07:00
Phillip Webb d91ffb6a59 Filter source @Configuration with @ComponentScan
Exclude self @Component when parsing @ComponentScan annotations.

Issue: SPR-10531
2013-05-06 15:53:20 -07:00
Phillip Webb db0d780d43 Support *Aware ImportSelectors
Implementations of Spring's ImportSelector interface may
now implement any of the following *Aware interfaces and have their
respective methods called prior to #registerBeanDefinitions:

 - BeanFactoryAware
 - BeanClassLoaderAware
 - ResourceLoaderAware

Issue: SPR-10530
2013-05-06 15:43:52 -07:00
Phillip Webb f05d0885ef Add AnnotationConfigApplicationContext constructor
Add AnnotationConfigApplicationContext constructor allow use of a
custom DefaultListableBeanFactory.

Issue: SPR-10529
2013-05-06 15:36:32 -07:00
Phillip Webb 2c887248f0 Make SpringFactoriesLoader.loadFactoryNames public
Update the SpringFactoriesLoader static loadFactoryNames method from
private to public.

Issue: SPR-10528
2013-05-06 15:32:52 -07:00
Phillip Webb a22bb43c0c Include cglib repack in core 2013-05-06 15:29:36 -07:00
Phillip Webb 84e4244793 Use source 1.7 until eclipse supports JDK 8
Specifically set the source level in generated eclipse projects to 1.7
rather than 1.8. Allows the current eclipse milestone (4.3 M6) in
combination with JDK 8.0 to be used for Spring 4.0 development.
2013-05-06 15:21:24 -07:00
Rossen Stoyanchev 59e6298c82 Merge remote-tracking branch 'upstream/master' 2013-05-06 16:44:35 -04:00
Rossen Stoyanchev 37c6a94905 Update deps for spring-websocket 2013-05-06 16:42:42 -04:00
Sam Brannen d01d95118b Stop suppressing warnings for deleted deprecations
This commit removes the use of @SuppressWarnings("deprecation") for
code in the spring-test module that no longer references deprecated code.

Issue: SPR-10499
2013-05-06 21:29:49 +02:00
Rossen Stoyanchev e7f38e5b17 Merge branch 'websocket' 2013-05-06 14:46:29 -04:00
Rossen Stoyanchev d89b18613f Polish (minor) 2013-05-06 14:33:00 -04:00
Rossen Stoyanchev 7845ebc428 Add SockJS path detection 2013-05-05 20:51:37 -04:00
Sam Brannen 72d5a32104 Added schema version to test XML config file
This commit adds an explicit version to the updated XML configuration
file in order to avoid build errors in IntelliJ IDEA 12.
2013-05-05 21:50:34 +02:00