Commit Graph

5844 Commits

Author SHA1 Message Date
Rossen Stoyanchev 3eda02d1b4 Update MediaType's includes method
An additional update (after the last commit) of the "includes" and
"isCompatibleWith" methods of MediaType to accomodate wildcards
in media types with a suffix.

Issue: SPR-9841
2012-10-06 10:56:32 -04:00
Rossen Stoyanchev 7718936158 Recognize wildcards in media types with a suffix
The "includes" and "isCompatibleWith" methods of MediaType take into
account media types with suffices (e.g. application/soap+xml) including
wildcards with suffices (e.g. application/*+xml). However before this
change, the isWildcardSubtype() method returned true only for subtype
"*". Now a media type such as application/*+xml is also recognized as
having a wildcard subtype.

Issue: SPR-9841
2012-10-06 10:01:56 -04:00
Rob Winch 2638dd5a05 merge-dist.gradle disables artifactoryPublish
Previously the project that was getting merged from would try to
execute the artifactoryPublish on the build box. This caused issues
since the mavenDescriptor did not exist.

The merge-dist.gradle now disables the artifactoryPublish task if it
exists (it will only exist on the build box).

Issue: SPR-9859, SPR-7951
2012-10-05 11:40:42 -05:00
Rob Winch 22bcb54ab6 Add Spring MVC Test framework
This commit adds the spring-test-mvc project [1] to the Spring
Framework as part of the spring-test module.

The sources are added as a root-level project called "spring-test-mvc"
instead of under "spring-test" because the new sources need to be
compiled with Servlet 3 while the current "spring-test" sources require
Servlet 2.5 and the Eclipse IDE does not support having different
classpaths for the same project.

The Gradle build produces a single spring-test jar that contains
sources from both "spring-test" and "spring-test-mvc". This merge is
made possible through merge-dist.gradle as follows:

- jar tasks of the "from" project execute tasks of the "to" project
- "to" project is added to the classpath of the "from" project
- "to" project pom is updated with entries from the "from" project

For further details see documentation in merge-dist.gradle.

Special thanks to everyone who contributed to the initial development
of the Spring MVC Test framework:

 Arjen Poutsma <poutsma@mac.com>
 Craig Walls <cwalls@vmware.com>
 Frans Flippo <fransflippo@utopia.orange11.nl>
 Harry Lascelles <harry@firstbanco.com>
 Irfan <mail.urfi@gmail.com>
 Jörg Rathlev <joerg.rathlev@s24.com>
 Keesun Baik <whiteship2000@gmail.com>
 Keesun Baik <whiteship@epril.com>
 Matthew Reid <matthew.reid@nakedwines.com>
 Nils-Helge Garli Hegvik <Nils-Helge.Hegvik@telenor.com>
 Rob Winch <rwinch@vmware.com>
 Scott Frederick <sfrederick@vmware.com>
 Sven Filatov <sven.filatov@gmail.com>
 Thomas Bruyelle <thomas.bruyelle@gmail.com>
 youngm <youngm@gmail.com>

[1]: https://github.com/SpringSource/spring-test-mvc

Issue: SPR-9859, SPR-7951
2012-10-05 12:02:25 -04:00
Sam Brannen 4812c181d4 Polish LiveBeansView Javadoc and suppress warnings 2012-10-04 14:10:52 +02:00
Rossen Stoyanchev 7513e2124a Sync up MockHttpServletResponse copies in test sources 2012-10-02 15:57:22 -04:00
Rossen Stoyanchev 5c13739afa Add mock implementations of Http[Input|Output]Message 2012-09-27 17:07:14 -04:00
Rossen Stoyanchev 4566db82f5 Polish MockFilterChain
A reset method now allows it to be invoked more than once each time
storing the request and response with which it was invoked.
2012-09-27 12:06:35 -04:00
Juergen Hoeller 49294c9d00 ClassUtils.getMostSpecificMethod uses Class.getMethod code path in case of a public method
This should be significantly faster than our standard algorithm, for a very common case. Motivated by SPR-9802, even if the fix there uses a different approach, with transaction name determination not calling getMostSpecificMethod at all anymore.

Issue: SPR-9802
2012-09-26 20:03:30 +02:00
Juergen Hoeller 89b365120a TransactionInterceptor avoids reflective method search for method identification
As of Spring 3.0.4, we were trying to expose the target method signature as transaction name. Unfortunately, the algorithm called the ClassUtils.getMostSpecificMethod helper method which performs a quite expensive reflective search. As of this commit, we're simply concatenating the target class name with the method name, accepting the use of the concrete target class (which is arguably more meaningful for monitoring anyway) even when the method implementation actually sits on a base class.

Issue: SPR-9802
2012-09-26 19:30:42 +02:00
Juergen Hoeller abf341c33a ResourceBundleMessageSource supports "defaultEncoding", "fallbackToSystemLocale", "cacheSeconds"
These features require Java 6 or higher due to their dependency on the ResourceBundle.Control class. To some degree, ResourceBundleMessageSource catches up with ReloadableResourceBundleMessageSource now. However, as noted in the javadoc, there are still severe limitations in the standard ResourceBundle class that justify an ongoing investment in our own ReloadableResourceBundleMessageSource (based on the Spring resource abstraction, with manual parsing of properties files).

Issue: SPR-7392
2012-09-26 16:55:14 +02:00
Juergen Hoeller 3c557bfbc3 LiveBeansView produces a well-defined (and valid) JSON document now
Issue: SPR-9662
2012-09-26 16:55:13 +02:00
Rossen Stoyanchev 7b30ffd522 Work around Servlet dependency in content negotiation
Before this change the PathExtensionContentNegotiationStrategy accessed
the ServletContext via request.getServletContext, which is Servlet 3
specific. To work around it, there is now a Servlet-specific sub-class
that accepts a ServletContext as a constructor argument.

The ContentNegotiationManagerFactoryBean is now ServletContextAware and
if it has a ServletContext it creates the Servlet-specific sub-class
of PathExtensionContentNegotiationStrategy.

The ContentNegotiationManagerFactoryBean is now also used in several
places internally -- MVC namespace, MVC Java config, and the
ContentNegotiatingViewResolver -- to reduce duplication.

Issue: SPR-9826
2012-09-26 09:28:43 -04:00
Rossen Stoyanchev 2bb0104556 Polish ObjectToStringHttpMessageConverter
Issue: SPR-9738
2012-09-25 19:32:26 -04:00
Rossen Stoyanchev 8a082e6e3b Merge pull request #148 from poutsma/SPR-9798
* poutsma-SPR-9798:
  Support opaque URIs in UriComponentsBuilder
2012-09-25 10:20:10 -04:00
Arjen Poutsma 6e45a79ecb Support opaque URIs in UriComponentsBuilder
Before this commit, UriComponentsBuilder did not handle opaque URIs at
all. After this commit it does.

Support is introduced by making UriComponents an abstract base class,
and having two concrete subclasses: HierarchicalUriComponents and
OpaqueUriComponents. The former is more or less the same as the old
UriComponents class.

Issue: SPR-9798
2012-09-25 10:18:49 -04:00
Dmitry Katsubo b2037c8316 Add ObjectToStringHttpMessageConverter
This new converter uses StringHttpMessageConverter internally combined
with a ConversionService for converting String content to and from the
target object type.

Issue: SPR-9738
2012-09-25 09:02:27 -04:00
Juergen Hoeller 0d88c73523 Calling cancel on a Future returned by a TaskScheduler works reliably now
Issue: SPR-9821
2012-09-25 13:53:07 +02:00
Juergen Hoeller 7fc16298e6 Fixed potential race condition in concurrent calling of autowired methods on a prototype bean
Autowired methods might have been skipped on subsequent creation of further bean instances due to the 'skip' flag set to false outside of the synchronized block, with another thread entering the block and setting the flag to true in the meantime.

Issue: SPR-9806
2012-09-25 12:49:38 +02:00
Juergen Hoeller e0bec678da Calling cancel on a Future returned by a TaskScheduler works reliably now
Issue: SPR-9821
2012-09-25 12:06:43 +02:00
Rossen Stoyanchev ef9d35c473 Add PATCH to "Allow" header for OPTIONS requests 2012-09-24 19:57:04 -04:00
Rossen Stoyanchev ce0ae84d95 Merge pull request #82 from rcrathore/master
* pull82-rcrathore-master:
  Add URI and method name on ResourceAccess
2012-09-24 19:38:09 -04:00
Ritesh Rathore 0baa1a56c2 Add URI and method name on ResourceAccess
Issue: SPR-9325
2012-09-24 19:36:45 -04:00
Rossen Stoyanchev e54fb60180 Merge pull request #129 from dmak/SPR-9739
* pull129-dmak-SPR-9739-jackson2-mapper:
  Add Jackson2ObjectMapperBeanFactory
2012-09-24 19:23:49 -04:00
Dmitry Katsubo 950786a8cc Add Jackson2ObjectMapperBeanFactory
Issue: SPR-9739
2012-09-24 19:22:33 -04:00
Juergen Hoeller 76e28cb08b Initial changelog for 3.2 RC1 2012-09-24 23:16:49 +02:00
Juergen Hoeller e5f3669804 Introduced beta version of LiveBeansView for STS 3.1
LiveBeansView includes MBean exposure as well as Servlet exposure, with JSON as the initial output format. In order to identify an MBean per application, a new "getApplicationName()" method got introduced on the ApplicationContext interface, returning the Servlet container context path in case of a web application and defaulting to the empty String. MBean exposure can be driven by the "spring.liveBeansView.mbeanDomain" property, e.g. specifying "liveBeansView" as its value, leading to "liveBeansView:application=" or "liveBeansView:application=/myapp" style names for the per-application MBean.

Issue: SPR-9662
2012-09-24 23:15:58 +02:00
Juergen Hoeller 53ae345a88 Moved JacksonObjectMapperFactoryBean from web.context.support to http.converter.json
Issue: SPR-9125
2012-09-24 11:39:09 +02:00
Juergen Hoeller dc4e0683ae ImportAwareBeanPostProcessor registered with ROLE_INFRASTRUCTURE 2012-09-24 11:26:47 +02:00
Juergen Hoeller aa4d9c48ab CookieGenerator supports "cookieHttpOnly" flag for Servlet 3.0
Issue: SPR-9794
2012-09-23 19:50:04 +02:00
Rossen Stoyanchev e26da7c2ab Merge pull request #150 from philwebb/SPR-9815
* philwebb-SPR-9815:
  Protect RequestCondition against unkown HTTP methods
  Polish trailing whitespace
2012-09-21 11:10:05 -04:00
Phillip Webb c0729756d7 Protect RequestCondition against unkown HTTP methods
The RequestMethodsRequestCondition is now protected against HTTP
request method values not present in the RequestMethod enumeration
(e.g. PROPFIND).

Issue: SPR-9815
2012-09-21 11:05:45 -04:00
Phillip Webb b0153ada19 Polish trailing whitespace 2012-09-21 10:55:17 -04:00
Rossen Stoyanchev d1d9e118b7 Merge pull request #151 from philwebb/SPR-9814
Delete CopyOfRequestMappingHandlerMapping class
2012-09-21 07:52:48 -07:00
Phillip Webb 4767f44671 Delete CopyOfRequestMappingHandlerMapping class
Previously committed in error.

Issue: SPR-9814
2012-09-20 17:25:00 -07:00
Rossen Stoyanchev 57c36dd395 Add interceptors for async processing
This change introduces two new interceptors with callback methods
for concurrent request handling. These interfaces are
CallableProcessingInterceptor and DeferredResultProcessingInterceptor.

Unlike a HandlerInterceptor, and its AsyncHandlerInterceptor sub-type,
which intercepts the invocation of a handler in he main request
processing thread, the two new interfaces are aimed at intercepting the
asynchronous execution of a Callable or a DeferredResult.

This allows for the registration of thread initialization logic in the
case of Callable executed with an AsyncTaskExecutor, or for centralized
tracking of the completion and/or expiration of a DeferredResult.
2012-09-19 09:25:50 -04:00
Chris Beams 30bce7fa16 Add CONTRIBUTING.md
Copied from the Contributor Guidelines wiki document [1] in order to
take advantage of GitHub's new integrated support for displaying a link
to contributor guidelines when issuing a pull request [2].

The wiki document has been updated to link to this document.

[1]: https://github.com/SpringSource/spring-framework/wiki/Contributor-guidelines
[2]: https://github.com/blog/1184-contributing-guidelines
2012-09-18 13:28:00 +01:00
Rossen Stoyanchev 97f97c4e9f Polish async support
Added handler argument to the signature of
AsyncHandlerInterceptor.afterConcurrentHandlingStarted(..).

Renamed AsyncWebUtils to WebAsyncUtils.
2012-09-17 14:58:56 -04:00
Chris Beams ccd7b10237 Merge pull request #147 from poutsma/SPR-9768
# By Arjen Poutsma
* SPR-9768:
  Preserve comments when using JibxMarshaller
2012-09-17 14:11:22 +01:00
Arjen Poutsma f191a55b8f Preserve comments when using JibxMarshaller
Prior to this commit, JibxMarshaller used a SAX ContentHandler to
marshal to StAX XMLEventWriters, which inadvertently resulted in the
deletion of XML comments.

After this commit, JibxMarshaller adapts the XMLEventWriter into an
XMLStreamWriter and comments are preserved.

Issue: SPR-9768
2012-09-17 14:07:02 +01:00
Chris Beams 17c6515c0a Increment version to 3.2.0.BUILD-SNAPSHOT 2012-09-12 04:08:39 +02:00
Spring Buildmaster 323ac6ad01 Release version 3.2.0.M2 2012-09-11 18:41:07 -07:00
Chris Beams c4aa14f343 Ignore SpringRunnerContextCacheTests
Avoid order-dependent test method failures on JDK7

Issue: SPR-9789
2012-09-11 23:54:35 +02:00
Chris Beams 6c8f795122 Add Created-By attribute to jar manifests
This commit ensures that the 'Created-By:' attribute [1] is added to
each jar's META-INF/MANIFEST.MF in order to identify clearly the vendor
and version of Java used during the build process.

[1]: http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html
2012-09-11 22:20:20 +02:00
Chris Beams 0af04910f9 Update STS version used to test Eclipse setup script 2012-09-11 17:32:30 +02:00
Chris Beams 3bebb23f64 Update changelog 2012-09-11 16:56:49 +02:00
Phillip Webb 73832f8c6e Support inferred base package for @ComponentScan
Prior to this change, @ComponentScan required the declaration of
exactly one of the #value, #basePackage or #basePackageClasses
attributes in order to determine which package(s) to scan.

This commit introduces support for base package inference, relaxing the
above requirement and falling back to scanning the package in which the
@ComponentScan-annotated class is declared.

Issue: SPR-9586
2012-09-11 16:50:01 +02:00
Chris Beams 512ffbb273 Update PortletRequestUtilsTests float test timeout
Float parameter handling appears to be marginally more expensive under
JDK7, with the testGetFloatParameterWithDefaultValueHandlingIsFastEnough
test clocking in anywhere from 250 to 315 ms. This violates the current
test threshold of 250 ms, so this commit ups the timeout value to 350 ms
with the assumption that this is indeed a marginal and therefore overall
negligible performance degradation.
2012-09-11 16:00:18 +02:00
Chris Beams ec2df7d229 Merge pull request #143 from olivergierke/SPR-9781
# By Oliver Gierke
* SPR-9781:
  Work around JDK7 String#substring performance regression
2012-09-11 15:06:48 +02:00
Oliver Gierke 3fb3b7d67a Work around JDK7 String#substring performance regression
String#substring has become significantly slower as of JDK 1.7.0_06 [1],
such that there are performance degradations by a factor of 100-1000 in
ResourceDatabasePopulator, especially for large SQL files.

This commit works around this problem by minimizing the substring scope
to the least amount possible to prevent unnecessary internal copying of
strings (which seems to cause the issue).

[1]: http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-May/010257.html

Issue: SPR-9781
2012-09-11 15:06:40 +02:00