Commit Graph

671 Commits

Author SHA1 Message Date
Juergen Hoeller 98d6f7b443 Polishing 2014-06-26 16:01:24 +02:00
Juergen Hoeller cc917de24d Polishing 2014-06-26 11:44:07 +02:00
Juergen Hoeller b3e3c5312f Introduced AnnotationConfigRegistry as common interface for AnnotationConfig(Web)ApplicationContext
Issue: SPR-11814
2014-06-26 11:43:03 +02:00
Brian Clozel 9919a98231 HttpHeaders fails getAllow if set to EmptyCollection
Prior to this commit, calls to getAllow would fail is setAllow was set
to an EmptyCollection right before.

    java.lang.IllegalArgumentException: No enum constant
    org.springframework.http.HttpMethod

This commit fixes this by testing the header value for an empty value
before trying to use it to get a value from the Enum.

Issue: SPR-11917
2014-06-25 23:12:35 +02:00
Juergen Hoeller d239016a8c UriComponentBuilder allows for multiple independent build() calls on same builder instance
Issue: SPR-11885
2014-06-25 13:19:28 +02:00
Juergen Hoeller 18131bf611 Consistent declaration of private static final logger variables
Issue: SPR-11905
2014-06-24 14:02:05 +02:00
Juergen Hoeller 88eabe874c Latest dependency updates (Jackson 2.4, Jetty 9.2.1, H2 1.4.178, Apache HttpClient 4.3.4) 2014-06-17 21:58:11 +02:00
Rossen Stoyanchev 0dc6082b01 Support java.util.Optional for @MVC named value args
After this change, java.util.Optional is supported with @RequestParam,
@RequestHeader, and @MatrixVariable arguments in Java 8. When Optional
is used the required flag is effectively ignored.

Issue: SPR-11829
2014-06-16 14:16:56 -04:00
Rossen Stoyanchev b214db3fc8 Rename HttpStatus 308 to Permanent Redirect
Issue: SPR-11854
2014-06-10 18:51:22 -04:00
Rossen Stoyanchev 56a82c1cbe Add dependency ordering for @ModelAttribute methods
Before this change @ModelAttribute methods were not invoked in any
particular order other than ensuring global @ControllerAdvice methods
are called first and local @Controller methods second.

This change introduces a simple algorithm that selects the next
@ModelAttribute method to invoke by making a pass over all methods and
looking for one that has no dependencies (i.e. @ModelAttribute
input arguments) or has all dependencies resolved (i.e. available in
the model). The process is repeated until no more @ModelAttribute
methods remain.

If the next @ModelAttribute method cannot be determined because all
remaining methods have unresolved dependencies, the first available
method is picked anyway just as before, i.e. with required
dependencies created through the default constructor.

Examples in ModelFactoryOrderingTests.

Issue: SPR-6299
2014-06-07 16:21:36 -04:00
Rossen Stoyanchev e374769ecc Polish ModelFactory 2014-06-07 16:21:35 -04:00
Juergen Hoeller ae66e45887 Refined tests for FactoryBean return type resolution on @Bean methods
Issue: SPR-11842
2014-06-07 00:24:45 +02:00
Juergen Hoeller 85b2c7d116 AbstractAutowireCapableBeanFactory's getTypeForFactoryBean considers FactoryBean<Object> declarations as non-indicative (just like raw declarations)
Issue: SPR-11842
2014-06-06 18:43:29 +02:00
Rossen Stoyanchev c269d27bde Improve no content handling in MockHttpServletRequest
Issue: SPR-11764
2014-06-06 11:25:15 -04:00
Juergen Hoeller f7b465390c Moved @Uses annotations to org.springframework.lang; fixed Base64Utils to declare Java 8, and fixed PathResource's declaration to refer to Java 7.
Issue: SPR-11604
2014-06-04 21:34:23 +02:00
Juergen Hoeller 64bb308763 GsonBuilderUtils for programmatic Base64 serialization setup; common Base64Utils class adapts between Java 8 and Commons Codec
Issue: SPR-9488
2014-06-04 13:22:11 +02:00
Juergen Hoeller 5ed9bedf32 Introducing GroovyWebApplicationContext along the lines of XmlWebApplicationContext and GenericGroovyApplicationContext
Also includes minor dependency updates such as Groovy 2.3.2.

Issue: SPR-11371
2014-05-30 17:35:00 +02:00
Juergen Hoeller 8220832c4e Polishing 2014-05-27 18:29:51 +02:00
Juergen Hoeller 22a38d4547 Revised GsonFactoryBean's configuration properties; made prettyPrinting test pass on Windows
Issue: SPR-9488
2014-05-27 18:26:48 +02:00
Juergen Hoeller 8f2ed66b4a ServletRequestAttributes considers standard Number subclasses (as defined in NumberUtils) as immutable
Issue: SPR-11738
2014-05-27 17:43:31 +02:00
Rossen Stoyanchev bc3ca2dea1 Polish 2014-05-22 22:21:52 -04:00
Roy Clarkson 811330f5c8 Add GsonHttpMessageConverter
This commit adds support to read and write JSON using the Google Gson
library. GsonHttpMessageConverter offers default Gson configuration, but
can be customized by using GsonFactoryBean. GsonFactoryBean includes
several convenience properties for configuring the internal GsonBuilder
and the resulting Gson object.

By default Gson converts byte arrays to JSON arrays instead of a Base64
encoded string. GsonBase64ByteArrayJsonTypeAdapter provides support to
read and write Base64 encoded byte arrays, and can be enabled in
GsonFactoryBean.

RestTemplate will enable GsonHttpMessageConverter only if Jackson 2 is
not found on the class path, because by default GsonHttpMessageConverter
supports the same media types as Jackson.

Issue: SPR-9488
2014-05-22 22:21:52 -04:00
Rossen Stoyanchev 1338d46a6e Add JSONP support for MappingJackson2MessageConverter
Issue: SPR-9899
2014-05-20 12:13:44 -04:00
Juergen Hoeller c7d1c49d6d Servlet 3 multipart request implements getParameterMap defensively as well
Issue: SPR-11074
2014-05-20 11:10:16 +02:00
Juergen Hoeller 6fef8b996c Polishing 2014-05-20 10:46:06 +02:00
Rossen Stoyanchev 8e096aeef5 Disable URL resolution in DTD declarations
Issue: SPR-11768
2014-05-19 22:45:12 -04:00
Juergen Hoeller a16eeabc4e Further UriComponentsBuilder javadoc revision
(cherry picked from commit 54636b3)
2014-05-20 01:26:08 +02:00
Juergen Hoeller d9b39ad691 Consistent use of IllegalStateException instead of InternalError for UnsupportedEncodingException cause 2014-05-20 00:37:09 +02:00
Juergen Hoeller 73c9d09024 UriComponentsBuilder.toUriString instead of RequestContext.getMvcUrl (breaking cyclic dependency between web.servlet.support and web.servlet.mvc) 2014-05-20 00:35:09 +02:00
Rossen Stoyanchev 51fc3b4aaf Refactor @JsonView support w/ ResponseBodyInterceptor
The newly added support for ResponseBodyInterceptor is a good fit for
the (also recently added) support for the Jackson @JsonView annotation.

This change refactors the original implementation of @JsonView support
for @ResponseBody and ResponseEntity controller methods this time
implemented as an ResponseBodyInterceptor.

Issue: SPR-7156
2014-05-19 15:47:16 -04:00
Juergen Hoeller 6188550a48 ServletRequestAttributes skips well-known immutable values when updating accessed session attributes
Issue: SPR-11738
2014-05-19 16:00:29 +02:00
Juergen Hoeller 82336c320d Servlet 3 multipart request implements getParameterNames defensively (for WebLogic 12 compatibility)
This commit also includes lazy resolution support for StandardServletMultipartResolver, along the lines of existing lazy mode in CommonsMultipartResolver.

Issue: SPR-11074
Issue: SPR-11730
2014-05-18 20:26:02 +02:00
Juergen Hoeller ea88bc2c81 Servlet/PortletResponse supported as a resolvable dependency now (in particular for web controllers)
This feature required support for response exposure on Servlet/PortletRequestAttributes, instead of just in the Servlet/PortletWebRequest subclasses.

Issue: SPR-11795
2014-05-16 18:06:29 +02:00
Sebastien Deleuze be0b69cbf1 Add support for Jackson serialization views
Spring MVC now supports Jackon's serialization views for rendering
different subsets of the same POJO from different controller
methods (e.g. detailed page vs summary view).

Issue: SPR-7156
2014-05-15 23:03:33 -04:00
Rossen Stoyanchev 3bdf8aefa9 Polish 2014-05-15 13:59:36 -04:00
Arjen Poutsma 0499fcbeb2 Move ResponseEntityBuilder into ResponseEntity
Moved the ResponseEntityBuilder into the ResponseEntity itself.

Issue: SPR-11752
2014-05-15 13:41:25 -04:00
Brian Clozel f651065b5e Polish 2014-05-14 18:37:31 +02:00
Arjen Poutsma eb65a37f4b Provide builder for ResponseEntity
This commit introduces a ResponseEntityBuilder, which allows for
building of a ResponseEntity through a fluent API.

Issue: SPR-11752
2014-05-14 08:26:22 -04:00
Rossen Stoyanchev 9d479feadd Add naming strategy for @MVC request mappings.
This change adds a strategy for assigning a default name to an
@RequestMapping controller method. The @RequestMapping annotation
itself now has a name attribute allowing the explicit assignment
of a mapping name.

This is mainly intended for use in EL expressions in views. The
RequestContext class now provides a getMvcUrl method that internally
delegates to MvcUriComponents to look up the handler method.

See the Javadoc of MvcUriComponents.fromMappingName.

Issue: SPR-5779
2014-05-06 15:27:53 -04:00
Mattias Severson f2991da6d6 Made string constants in HttpHeaders public
Issue: SPR-11749
2014-05-01 13:37:39 -04:00
Rossen Stoyanchev 676282c66e Support ListenableFuture on @RequestMapping methods
Issue: SPR-11695
2014-05-01 12:28:59 -04:00
Rossen Stoyanchev 0d2aa51576 Update ContentNegotiationManager for unknown path exts
This change refines the logic of "mapping" content negotiation
strategies with regards to how to handle cases where no mapping is
found.

The request parameter strategy now treats request parameter values that
do not match any mapped media type as 406 errors.

The path extension strategy provides a new flag called
"ignoreUnknownExtensions" (true by default) that when set to false also
results in a 406. The same flag is also exposed through the
ContentNegotiationManagerFactoryBean and the MVC Java config.

Issue: SPR-10170
2014-05-01 12:03:06 -04:00
Stephane Nicoll bd85c916eb Integrate animal sniffer
Animal sniffer provides tools to assist verifying that classes
compiled with a newer JDK are compatible with an older JDK.

This integratesthe latest version of the tool (1.11) that
permits the use of custom annotations. Added @UsesJava7,
@UsesJava8 and @UsesSunHttpServer and annotated the few places
where we rely on a specific environment.

The verification process can be invoked by running the 'sniff'
task.

Issue: SPR-11604

polishing
2014-04-30 13:51:01 +02:00
Chexpir 77a250ef92 Update RequestMapping javadoc typo. 2014-04-28 22:13:17 -04:00
Juergen Hoeller 8e6e6c22af Test for base package specified as config location
Issue: SPR-11647
2014-04-28 21:31:38 +02:00
Juergen Hoeller 6f2e61b19f Polishing
(cherry picked from commit c97c246)
2014-04-28 00:47:50 +02:00
Juergen Hoeller ec7d80b851 Polishing 2014-04-23 23:03:47 +02:00
Juergen Hoeller 21f9ca088d ServletServerHttpResponse specifically checks for Servlet 3.0's HttpServletResponse.getHeader(String) method
Issue: SPR-11712
2014-04-23 22:47:54 +02:00
Juergen Hoeller 794e859e68 checkNotModified leniently handles IE-10-style If-Modified-Since values and silently proceeds if header value cannot be parsed at all
Issue: SPR-11727
2014-04-23 18:16:43 +02:00
Juergen Hoeller 3f392e32f5 ShallowEtagHeaderFilter writes body early on sendError/sendRedirect and interprets setContentLength/setBufferSize as a hint for capacity increase
Issue: SPR-11705
Issue: SPR-11717
2014-04-22 23:14:48 +02:00
Stephane Nicoll 5559209233 Remove useless imports 2014-04-22 09:57:12 +02:00
Philippe Marschall d00d0b0274 Clean up spring-web tests warnings
Clean up compiler warnings in the tests of spring-web. This commit
adds type parameters to all the types (mostly `List` and `Map`).

After this commit the only warnings in spring-web left are in
* `MockExpressionEvaluator` this can't be fixed until JSP-EL is fixed
* `Jackson2ObjectMapperFactoryBeanTests#testSetModules` that code
   would never compile with generics.
2014-04-22 07:30:42 +02:00
Sam Brannen 408fe42df2 Fix Javadoc syntax error in HttpRequestHandler 2014-04-22 01:01:07 -04:00
Juergen Hoeller 086f1eda71 Polishing 2014-04-17 22:39:47 +02:00
Sam Brannen 711c95d7d2 Clean up warnings due to removal of legacy Jackson support 2014-04-06 16:28:28 +02:00
Juergen Hoeller 8006696613 Revised ByteArrayOutputStream handling in MarshallingView and co
Issue: SPR-11646
2014-04-02 20:57:09 +02:00
Stephane Nicoll dcf5f4a6a3 javax.annotation.Priority alternative to @Order
This commit rationalizes the use of @Order so that the standard
@Priority annotation can be used instead. The handling of both
annotations are now defined in OrderUtils.

This also updates the link to the JavaEE API so that we refer to
JavaEE7 instead of JavaEE6.

Issue: SPR-11639
2014-04-01 14:30:47 +02:00
Juergen Hoeller ea1e27efa2 Require Jackson 2.0+, EhCache 2.5+, Quartz 2.1.4+
Issue: SPR-11262
2014-03-27 21:59:23 +01:00
Juergen Hoeller 074590730b Polishing 2014-03-25 00:54:02 +01:00
Juergen Hoeller 53352882ca Polishing 2014-03-24 22:58:33 +01:00
Juergen Hoeller dd7f54c3c0 Revised ResizableByteArrayOutputStream as an actual subclass of ByteArrayOutputStream, and consistently applied appropriate ByteArrayOutputStream initial capacities across the codebase
Issue: SPR-11594
2014-03-24 22:57:38 +01:00
Brian Clozel ae012ae6e2 ShallowEtagHeaderFilter use specified contentlength
Prior to this commit, the ShallowEtagHeaderFilter did not use the
content length given by the content generator to set the
ByteArrayOutputStream's buffer size.
This can lead to performance issues for large content since the buffer
grows as the content is being written.

This commit adds a new ByteArrayOutputStream variant called
ResizableByteArrayOutputStream. This implementation has public methods
for modifying the internal buffer size and does not synchronize on
buffer access.
This commit also make use of this new variant in
ShallowEtagHeaderFilter.

Issue: SPR-8271
2014-03-24 12:11:59 +01:00
Juergen Hoeller 90e3dbb0f5 BufferedImageHttpMessageConverter ignores empty MIME types
Issue: SPR-11581
2014-03-21 14:43:03 +01:00
Stephane Nicoll 4cd818b9e4 Harmonize log configuration
Prior to this commit, the codebase was using a mix of log4j.xml
and log4j.properties for test-related logging configuration. This
can be an issue as log4j takes the xml variant first when looking
for a default bootstrap configuration.

In practice, some modules declaring the properties variant were
taking the xml variant configuration from another module.

The general structure of the configuration has also been
harmonized to provide a standard console output as well as an
easy way to enable trace logs for the current module.
2014-03-20 09:43:29 -07:00
Juergen Hoeller e0757e7ed6 Detect ControllerAdvice beans in ancestor contexts as well
Issue: SPR-11570
2014-03-18 22:29:50 +01:00
Sam Brannen 9dcd03d862 Clean up imports and warnings 2014-03-14 17:34:21 +01:00
Juergen Hoeller 791f58e6be Polishing 2014-03-13 17:31:39 +01:00
Rossen Stoyanchev 6b31074e4a Add HTTP series check shortcut methods to HttpStatus
Issue: SPR-11424
2014-03-12 17:04:16 -04:00
Juergen Hoeller 4d3ca4319e Polishing 2014-03-11 22:09:46 +01:00
Juergen Hoeller bbcb1837c5 Polishing
Issue: SPR-11442
2014-03-10 18:31:03 +01:00
Stephane Nicoll 7a6ec69523 Fix custom config with older HttpClient
Since HttpClient 4.3, custom configuration such as the connection
timeout and the socket timeout are set in a RequestConfig object
stored in the HttpContext.

Unfortunately, older HttpClients are not supporting this
infrastructure and new clients throw an exception when the
deprecated API is used.

This commit detects if the client is an "old" implementation and
set the configuration through the deprecated means to restore
full backward compatibility with these features.

Issue: SPR-11442
2014-03-10 17:42:09 +01:00
Juergen Hoeller 3080ff3890 Polishing 2014-03-06 14:18:26 +01:00
Rossen Stoyanchev 49d7bda722 Improve CORS handling in AbstractSockJsService
After this change, AbstractSockJsService does not add CORS headers if
the response already contains an "Access-Control-Allow-Origin" header.
Essentially it backs off assuming CORS headers are handled centrally
e.g. through a Filter.

In order to support this, the ServletServerHttpResponse now returns an
instance of HttpHeaders that also provides access to headers already
present in the HttpServletResponse.

Issue: SPR-11443
2014-03-05 21:06:46 -05:00
Sam Brannen 9891bdc7b4 Clean up "abstract" test issues
- Deleted empty AbstractWebSocketClientTests class.

 - AbstractServletHandlerMethodTests and AbstractHttpRequestTests are
   now actually declared as abstract.

 - The following classes are not abstract but currently have an
   "Abstract" prefix and therefore get ignored by the Gradle build.
   This commit renames each of these by deleting the "Abstract" prefix.

   - AbstractFlashMapManagerTests
   - AbstractMappingContentNegotiationStrategyTests
   - AbstractSockJsServiceTests
   - AbstractWebSocketHandlerRegistrationTests
2014-03-05 12:41:26 +01:00
Juergen Hoeller 9b771573ec Log4jWebConfigurer does not try to parse empty "log4jRefreshInterval" context-param
Issue: SPR-11507
2014-03-04 13:31:59 +01:00
Rossen Stoyanchev c553d681f1 Add Servlet 3.1 methods to mock request
Issue: SPR-11492
2014-02-28 12:28:17 -05:00
Rossen Stoyanchev c4000727ef Move customize(Un)Marshaller methods to abstract class
Issue: SPR-11488
2014-02-28 11:54:34 -05:00
Sebastien Deleuze 45be8c0692 Add marshalling hooks in Jaxb2RootElementHttpMessageConverter
Allow Jaxb2RootElementHttpMessageConverter subclasses to customize
the {@link Marshaller} and the {@link Unmarshaller} created by the
message converter.

Issue: SPR-11488
2014-02-28 11:48:31 -05:00
Rossen Stoyanchev edba32b309 Add processExternalEntities support to OXM
Update OXM AbstractMarshaller to support processing of external
XML entities. By default external entities will not be processed.

Issue: SPR-11376
2014-02-18 15:54:30 -08:00
Rossen Stoyanchev 268657b6cb Add PropertyNamingStrategy field to ObjectMapperFB
Issue: SPR-11431
2014-02-17 14:57:22 -05:00
Juergen Hoeller bde4964af5 Polishing 2014-02-14 23:48:13 +01:00
Juergen Hoeller 8a96d1a6ee Polishing 2014-02-14 23:40:03 +01:00
Juergen Hoeller 9c6df766cd Related polishing
Issue. SPR-11428
2014-02-14 21:38:44 +01:00
Brian Clozel 6fba8292f5 Restrict ETag generation in ShallowEtagHeaderFilter
Prior to this commit, all 2xx HTTP responses were eligible for ETag
generation in ShallowEtagHeaderFilter. In some cases, this would use
CPU resources for no reason since HTTP clients would not use ETags.

This commit is an optimization and restricts ETags generation in cases
where (all conditions must be met):
- response has a 2xx status
- request is a GET
- response does not contain "no-store" in its "Cache-Control" header

Issue: SPR-11110
2014-02-14 09:52:40 +01:00
Rossen Stoyanchev 0cb27f4bc5 Allow HttpMethod as a controller method argument
Issue: SPR-11425
2014-02-13 12:16:24 -05:00
Juergen Hoeller 0ec99fdef7 Polishing 2014-02-12 18:36:04 +01:00
Juergen Hoeller cead06a3d9 Polishing 2014-02-12 00:12:52 +01:00
Juergen Hoeller 1a1c72ce4b Revised InvocableHandlerMethod exception handling
Issue: SPR-11281
2014-02-11 23:48:10 +01:00
Juergen Hoeller 5f1592a61a Consistently avoid close() call on Servlet OutputStream
Issue: SPR-11413
2014-02-11 23:42:37 +01:00
Rossen Stoyanchev 7301b58ec9 Improve info on use of @Controller's with aop proxying
Before this change, issues surrounding the use of @Controller's in
combination with AOP proxying, resulted in an IllegalArgumentException
when trying to invoke the controller method.

This change detects such cases proactively and reports them with a
clear recommendation to use class-based proxying when it comes to
@Controller's. This is the most optimcal approach for controllers
in many respects, also allows @MVC annotations to remain on the
class.

The documentation has also been updated to have a specific section
on @Controller's and AOP proxying providing the same advice.

Issue:SPR-11281
2014-02-11 12:25:54 -05:00
Rossen Stoyanchev 12598f8581 Fix issue w/ use of UrlPathHelper's urlDecode property
Before this change the getPathWithinServletMapping method of
UrlPathHelper could not work properly when a default servlet mapping
(i.e. "/") was used in combination with urlDecode=false. The fact that
the getServletPath() method of HttpServletRequest always returns a
decoded path was getting in the way.

Although there is no way to check Servlet mappings through the Servlet
API, this change aims to detect the given scenario and returns the full
path following the context path thus avoiding URL decoding.

Note that the same can be achieved by setting urlDecode=false and
alwaysUseFullPath=true. However this change ensures that urlDecode
works properly without having to know that.

Issue: SPR-11101
2014-02-10 21:08:57 -05:00
Sam Brannen c335e99e3f Remove trailing whitespace from source code 2014-02-08 17:30:39 +01:00
Sam Brannen 1f778530b5 Polish test classes
- Consistent importing of org.junit.Assert.*;
- Proper declaration of expected exceptions via @Test(expected).
- Renamed SpEL ExpressionTestCase to AbstractExpressionTests.
- Formatting and test method naming conventions.
2014-02-08 17:24:11 +01:00
Juergen Hoeller 919d6ccb3b Actually log the cause of canRead/canWrite failures
Issue: SPR-11403
2014-02-07 17:27:17 +01:00
Rossen Stoyanchev 42d0470d94 Improve expanding in MvcUriComponentsBuilder
Before this change MvcUriComponentsBuilder could not create a
UriComponentsBuilder for methods where the mapping has a URI variable
and no matching method argument for it.

For example a URI variable may be in the type-level mapping but not
all methods may have an @PathVariable argument for it.

This fix addresses the shortcoming such that MvcUriComponentsBuilder
expands the method argument values available to it and leaves remaining
URI variables to be further expanded via UriComponents.expand().

Issue: SPR-11391
2014-02-06 16:55:19 -05:00
Sam Brannen 67142dcb0a Polish Javadoc in @*ExceptionHandler 2014-02-05 20:15:50 +01:00
Rossen Stoyanchev 1a8629d408 Fix failing test 2014-02-03 21:44:13 -05:00
Sam Brannen b8ed2f4967 Ensure all tests are executed in the Gradle build
Prior to this commit several test classes named "*Test" were not
recognized as tests by the Gradle build. This is due to the configured
inclusion of '**/*Tests.*' which follows Spring's naming convention for
test classes.

This commit addresses this issue by:

 - Renaming real test classes consistently to "*Tests".
 - Renaming internal test classes to "*TestCase".
 - Renaming @WebTest to @WebTestStereotype.
 - Disabling broken tests in AnnoDrivenStaticEntityMockingControlTest.
 - Modifying the Gradle build configuration so that classes ending in
   either "*Tests" or "*Test" are considered test classes.

Issue: SPR-11384
2014-02-03 23:16:47 +01:00
Rossen Stoyanchev 1c5cab2a40 Add external entity test
Issue: SPR-11376
2014-02-03 16:57:03 -05:00
Juergen Hoeller f053f60630 Revised javadoc and related polishing
Issue: SPR-11383
2014-02-03 16:05:00 +01:00
Juergen Hoeller 5f2429429f Defensively handle ServletRequestAttributes casting in requestDestroyed callback
Issue: SPR-11378
2014-02-01 11:04:36 +01:00
Rossen Stoyanchev b6da7e2795 Fix test in Jaxb2RootElementHttpMessageConverterTests 2014-01-31 20:17:44 -05:00
Rossen Stoyanchev e680e34620 Fix test class name 2014-01-31 16:26:28 -05:00
Sam Brannen 474f1b03cd Fix grammar in Javadoc for @ResponseBody 2014-01-31 17:02:40 +01:00
Juergen Hoeller 47395f6b0a Dropped explicit paragraph on web.xml version declaration
Issue: SPR-11364
(cherry picked from commit 36ab65a)
2014-01-28 17:34:27 +01:00
Juergen Hoeller c5f908b174 Consistent use of headersExtractor() template method 2014-01-28 12:56:53 +01:00
Brian Clozel 425e5a066e Add RestTemplate constructor with custom converters
Prior to this commit, RestTemplate's constructors were all initializing
default HTTPMessageConverters. Its API provides a way to replace
those converters with custom ones, but default converters are already
defined and initialized at that point, which can be an issue in some
cases (performance, classpath...).

This commits adds a new constructor for RestTemplate with a list
of message converters as argument. With this new constructor,
default message converters are never initialized.

Issue: SPR-11351
2014-01-28 11:33:45 +01:00
Brian Clozel cc0a845653 Support Part/MultiPartFile arrays in ArgumentResolvers
Prior to this commit, parts of a multipart HTTP request could be
injected in @RequestPart and @RequestParam annotated arguments, when
using types:
* MultipartFile, Collection<MultiPartFile>
* javax.servlet.Part, Collection<Part>

This commits updates @RequestParam and @RequestPart argument resolvers
and now allows the array versions of those types:
* Part[]
* MultiPartFile[]

Note that the MockHtpServletRequest backing tests for standard
Servlets implementations now uses a MultiValueMap to store parts
(versus a simple hashmap).

Issue: SPR-11353
2014-01-27 18:09:29 +01:00
Sam Brannen 78542777d6 Introduce value attribute in @RestController
Stereotype annotations should support a 'value' attribute for
specifying the name of the Spring-managed component; however,
@RestController currently does not provide such an attribute.

This commit introduces a 'value' attribute in @RestController so that
developers can provide custom names for components annotated with
@RestController.

Issue: SPR-11360
2014-01-27 12:07:23 +01:00
Juergen Hoeller 21eb8db5bc Polishing
Issue: SPR-11357
2014-01-24 18:30:31 +01:00
Juergen Hoeller 42db41e007 Polishing 2014-01-23 20:59:53 +01:00
Juergen Hoeller 9c3a972dac Polishing
Issue: SPR-11297
(cherry picked from commit fc36184)
2014-01-23 00:16:29 +01:00
Juergen Hoeller 3514242486 SourceHttpMessageConverter's supports implementation needs to check for StAXSource
Issue: SPR-11341
2014-01-21 16:35:47 +01:00
Rossen Stoyanchev 17e492e641 Polish
Issue: SPR-11129
2014-01-20 21:48:57 -05:00
Juergen Hoeller e2c6e637a4 Polishing 2014-01-16 00:04:20 +01:00
Juergen Hoeller 17cc63ef63 checkNotModified needs to consider HEAD as well
Issue: SPR-11317
2014-01-15 23:06:47 +01:00
Juergen Hoeller a5f9b29292 Polishing 2014-01-15 22:53:46 +01:00
Juergen Hoeller 91881ff036 Introduced "globalInitializerClasses" next to the existing "contextInitializerClasses", applying to FrameworkServlets as well
Issue: SPR-11314
2014-01-15 22:21:27 +01:00
Juergen Hoeller 5661d3826c Fixed Jackson2ObjectMapperFactoryBean class name in javadoc examples 2014-01-05 00:15:33 +01:00
Juergen Hoeller 11b3fe2289 Added setModulesToInstall with convenient Class vararg, renamed setFindModules to setFindModulesViaServiceLoader, made existing setModules override any other setting
Issue: SPR-11040
2014-01-04 23:29:05 +01:00
Rossen Stoyanchev 12fe9174f0 Make ObjectMapper configurable in spring-messaging
Issue: SPR-11279
2014-01-02 11:27:18 -05:00
Juergen Hoeller 0657136605 Support for Jackson's findModules and autodetection of JSR-310 and Joda-Time support
Issue: SPR-11040
2013-12-29 21:52:58 +01:00
Juergen Hoeller 85921808b3 MappingJackson2(Http)MessageConverter logs warnings after canRead/canWrite checks
This change involves a general upgrade to Jackson 2.3 in our build.

Issue: SPR-11261
2013-12-29 21:50:43 +01:00
Juergen Hoeller 260bbe319d Fixed accidental use of Java 8 getParameterCount(), plus polishing of related classes
Issue: SPR-11245
2013-12-18 18:08:32 +01:00
Rossen Stoyanchev ff92f5af57 Fix typo
Issue: SPR-11241
2013-12-17 08:26:50 -05:00
Juergen Hoeller 2a3ca619f9 Polishing
Issue: SPR-11221
2013-12-17 12:40:21 +01:00
Rossen Stoyanchev 5f38996cd6 Add methods for static resolution of @ExceptionHandler 2013-12-09 08:19:17 -05:00
Juergen Hoeller f70739430b Polishing 2013-12-08 23:27:31 +01:00
Juergen Hoeller ea8a2095ec Polishing 2013-12-06 21:51:18 +01:00
Juergen Hoeller 2a52decbbc Polishing (including removal of javadoc imports that show as package cycles in IntelliJ) 2013-12-02 23:57:00 +01:00
Phillip Webb 043a41e382 Consistent whitespace after imports
Update code to have a consistent number of new-line characters after
import statements.
2013-11-26 15:14:43 -08:00
Phillip Webb 15698860e1 General polish of new 4.0 classes
Apply consistent styling to new classes introduced in Spring 4.0.

- Javadoc line wrapping, whitespace and formatting
- General code whitespace
- Consistent Assert.notNull messages
2013-11-26 15:11:18 -08:00
Phillip Webb a31ac882c5 Fix various javadoc warnings 2013-11-26 13:25:37 -08:00
Eric Dahl e9f78f6043 Fix various typos
Fix a variety of typos throughout the project, primarily in
comments (javadoc or otherwise) but also in a handful of log messages
and a couple exception messages.

ISSUE: SPR-11123
2013-11-25 15:58:27 -08:00
Phillip Webb 59002f2456 Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.

Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.

Issue: SPR-11064
2013-11-25 12:52:42 -08:00
Juergen Hoeller 0de112198e Rely on presence of Servlet 2.5's ServletContext.getContextPath() 2013-11-20 14:50:32 +01:00
Brian Clozel cc4faa5990 Fix standard multipart binding + Polish
Fixing standard multipart binding when multiple parts share
the same name.

Uncomment previously @Ignored tests now that Jetty supports
Servlet 3.0 spec.

Issue: SPR-10591
2013-11-19 17:13:31 -08:00
Juergen Hoeller b43901ed86 Upgraded to JSF 2.0 baseline; building against JSF 2.2 now 2013-11-15 12:07:42 +01:00
Rossen Stoyanchev 2ae6a6a341 Disable ext entities in SourceHttpMessageConverter
This change disables the processing of external entities in
SourceHttpMessageConverter by default and provides an option to enable
it if required.
2013-11-05 09:23:20 -05:00
Rossen Stoyanchev bfa6c2d5a2 Tweak method signatures in HttpComponentsClientHttpRF
This change replaces CloseableHttpClient with HttpClient in the
methods signatures of HttpComponentsClientHttpRequestFactory.
This allows 3rd party libraries such as Spring OAth, which configure
an instance of HttpComponentsClientHttpRequestFactory on the
RestTemplate to remain compatible with both Spring Framework 3/4

Issue: SPR-11053
2013-10-31 11:10:35 -04:00
Juergen Hoeller 84bc474016 Upgraded to Apache HttpComponents HttpClient 4.3.1 and HttpAsyncClient 4.0 GA, as well as Jackson 2.2.2 2013-10-31 15:26:11 +01:00
Sam Brannen 2e6c998168 Update Javadoc for mocks regarding Servlet 3.0
Commit deba32cad9 upgraded the Servlet API mocks to Servlet 3.0;
however, not all of the Javadoc was updated accordingly.

This commit updates the remaining Javadoc with regard to Servlet 3.0 as
the baseline for mocks in the spring-test module.

In addition, this commit syncs up the mocks used for internal testing in
the spring-web module with the most current versions from spring-test.

Issue: SPR-11049
2013-10-31 11:51:15 +01:00
Rossen Stoyanchev 5d8fac86d7 Add timeout async request handling to OSIV components
This change adds async web request timeout handling to OSIV filters
and interceptors to ensure the session or entity manager is released.

Issue: SPR-10874
2013-10-30 22:54:21 -04:00
Brian Clozel 397d52ad17 Upgrade to Jetty 9.1.0 .RC0
This commit upgrades Jetty to the latest available 9.1.x version while
also preserving compatibility with 9.0.x.
2013-10-29 15:02:25 -04:00
Rossen Stoyanchev 81dda069af Update WebSocket extensions change
- add WebSocketHttpHeaders
- client-side support for WebSocket extensions
- DefaultHandshakeHandler updates
- replace use of ServletAttributes in JettyRequestUpgradeStratey
- upgrade spring-web to jetty 9.0.5
2013-10-28 22:40:22 -04:00
Rossen Stoyanchev cf5db8362b Replace MvcUrls with MvcUriComponentsBuilder
Issue: SPR-8826
2013-10-25 22:29:38 -04:00
Phillip Webb 12e896ed8b Polish 2013-10-25 16:42:47 -07:00
Rossen Stoyanchev bafc73f147 Integrate suggested support for creating MVC URLs
The key contract is MvcUrls. An instance is automatically created with
the Spring MVC namespace and the MVC Java config but can also be easily
created in any configuration.

Some example tests can be found in DefaultMvcUrlsTests.

Issue: SPR-10665, SPR-8826
2013-10-21 16:26:08 -04:00
Oliver Gierke 4fd27b12fc Introduced MvcUriComponentsBuilder to create URIs pointing to controller methods.
MvcUriComponentsBuilder allows creating URIs that point to Spring MVC
controller methods annotated with @RequestMapping. It builds them by
exposing a mock method invocation API similar to Mockito, records the
method invocations and thus builds up the URI by inspecting the mapping
annotations and the parameters handed into the method invocations.

Introduced a new SPI UriComponentsContributor that should be implemented 
by HandlerMethodArgumentResolvers that actually contribute path segments 
or query parameters to a URI. While the newly introduced 
MvcUriComponentsBuilder looks up those UriComponentsContributor instances 
from the MVC configuration.

The MvcUriComponentsBuilderFactory (name to be discussed - MvcUris maybe?) 
prevents the multiple lookups by keeping the UriComponentsBuilder 
instances in an instance variable. So an instance of the factory could 
be exposed as Spring bean or through a HandlerMethodArgumentResolver to 
be injected into Controller methods.

Issue: SPR-10665, SPR-8826
2013-10-21 16:26:07 -04:00
Rossen Stoyanchev 4f28c77db7 Polish ControllerAdvice selectors
Issue: SPR-10222
2013-10-18 12:24:55 -04:00
Brian Clozel c4a8bf9c4d Add new features on @ControllerAdvice
Prior to this commit, @ControllerAdvice annotated beans would
assist all known Controllers, by applying @ExceptionHandler,
@InitBinder, and @ModelAttribute.

This commit updates the @ControllerAdvice annotation,
which accepts now base package names, assignableTypes,
annotations and basePackageClasses.

If attributes are set, only Controllers that match those
selectors will be assisted by the annotated class.
This commit does not change the default behavior when
no value is set, i.e. @ControllerAdvice().

Issue: SPR-10222
2013-10-18 11:35:06 -04:00
Juergen Hoeller 187b681b9e Consistency between InvocableHandlerMethod in web and messaging modules 2013-10-16 01:51:48 +02:00
Juergen Hoeller 3bd6dfe047 Autowiring of generic types
Includes revisions of MethodParameter and DependencyDescriptor (in particular towards a reference to the containing class). Also refines several ResolvableType method signatures.

Issue: SPR-9965
2013-10-15 00:11:23 +02:00
Juergen Hoeller 74794190a5 Implement java.io.Flushable wherever applicable 2013-10-14 23:52:31 +02:00
Rossen Stoyanchev 8ae88c20d1 Add support for resolving message headers
This change adds support for @Header and @Headers annotated method
arguments to spring-messaging. Also supported are arguments of type
MessageHeaders, and MessageHeaderAccessor (including sub-types of
MessageHeaderAccessort as long as they provide a wrap(Message<?>)
static factory method).

This change also renames @MessageBody to @Payload.

Issue: SPR-10985
2013-10-13 11:13:16 -04:00
Phillip Webb ca9df4d2ef Return rather than throw converted http exception
Fix HttpInvokerClientInterceptor.convertHttpInvokerAccessException to
return the translated exception rather than throwing it. This brings
the method implementation in line with the Java Doc and the obvious
original intent.

Issue: SPR-10965
2013-10-11 14:47:58 -07:00
Juergen Hoeller 4574528a27 Comprehensive update to the framework's TimeZone handling, including a new TimeZoneAwareLocaleContext and a LocaleContextResolver for Spring MVC
A few noteworthy minor changes: LocaleContext.getLocale() may return null in special cases (not by default), which our own accessing classes are able to handle now. If there is a non-null TimeZone user setting, we're exposing it to all collaborating libraries, in particular to JSTL, Velocity and JasperReports. Our JSR-310 and Joda-Time support falls back to checking the general LocaleContext TimeZone now, adapting it to their time zone types, if no more specific setting has been provided. Our DefaultConversionService has TimeZone<->ZoneId converters registered. And finally, we're using a custom parseTimeZoneString method now that doesn't accept the TimeZone.getTimeZone(String) GMT fallback for an invalid time zone id anymore.

Issue: SPR-1528
2013-10-04 23:14:08 +02:00
Juergen Hoeller 52cca48f40 Polishing 2013-10-04 22:53:49 +02:00
Juergen Hoeller 8b3afda6f4 Marked Jackson 1.x support classes as deprecated 2013-10-04 22:52:47 +02:00
Brian Clozel a5e3916724 Add Jackson's Modules registration in Jackson2OMFactoryBean
Prior to this commit, one couldn't configure Jackson's ObjectMapper
with (De)SerializerModifiers or advanced configuration features
using XML configuration.

This commit updates the FactoryBean and adds a setModule method
that will register Modules with the ObjectMapper.

Note that this commit is only about XML configuration, since
this feature was already available with JavaConfig.

Issue: SPR-10429
2013-10-02 17:23:55 -04:00
Brian Clozel e91ce23cd0 Add javax.servlet.http.Part support for data binding
Prior to this commit, Multipart databinding would only support
MultiPartFile databinding using commons-multipart.

Now the WebRequestDataBinder supports Part and List<Part>
databinding for Servlet 3.0 compliant containers.

Issue: SPR-10591
2013-10-02 17:19:44 -04:00
Rossen Stoyanchev 92795f463a Polish
Issue: SPR-10539
2013-09-25 12:47:50 -04:00
Brian Clozel 2dd4480103 Add IPv6 support in RestTemplate
Prior to this commit, RestTemplate would not would
not accept IPv6 raw addresses in URLs because UriComponentsBuilder
would not parse/encode the Host part correctly.

The UriComponentsBuilder now parses and encode raw IPv6 addresses
in the "[1abc:2abc:3abc::5ABC:6abc]" format and also supports the
use of IPv6 scope_ids (see JDK8 java.net.Inet6Address),
like "[1abc:2abc:3abc::5ABC:6abc%eth0]".

Issue: SPR-10539
2013-09-25 16:28:12 +02:00
Juergen Hoeller 5e88fe5842 Clarified Spring 4.0's dependency on JAX-WS 2.1+ / JAXB 2.1+ in javadoc 2013-09-25 12:54:25 +02:00
Arjen Poutsma d0aa158aef Added ListenableFuture interface
Added extension to Future with capabilities for registering callbacks
when the future is complete.

- Added ListenableFuture, ListenableFutureCallback,
  ListenableFutureCallbackRegistry, and ListenableFutureTask.
- Using ListenableFuture in AsyncRestOperations/AsyncRestTemplate.
- Added AsyncListenableTaskExecutor, implemented in
  SimpleAsyncTaskExecutor.
- Added FutureAdapter and ListenableFutureAdapter.
2013-09-04 14:32:47 +02:00
Arjen Poutsma e33324b700 Changed Future<Void> to Future<?>
Changed return values of Future<Void> to Future<?> in AsyncRestTemplate
and AsyncRestOperations.
2013-09-02 15:33:30 +02:00
Oleg Kalnichevski 296e2189a2 Post SPR-8804 optimizations: better use of HC 4.3 APIs 2013-08-29 13:28:00 +02:00
Juergen Hoeller 38c8c6d085 Turned AsyncRequestCallbackAdapter into a private inner class
Issue: SPR-8804
2013-08-28 12:56:18 +02:00
Juergen Hoeller 4447248a83 Introduced support for @Lazy on injection points
This turned into a rather huge affair since it led to the introduction of a new AutowireCandidateResolver implementation in the spring-context module. That ACR impl is now being set through AnnotationConfigUtils; GenericApplicationContext and co do not set a default QualifierAnnotationAutowireCandidateResolver anymore (which has always been a smell anyway).  At the same time, dependency ordering has moved from AutowiredAnnotationBeanPostProcessor to DefaultListableBeanFactory itself through a "dependencyComparator" strategy, applying to constructor dependencies and lazy resolution proxies as well.

Issue: SPR-10353
2013-08-28 00:14:39 +02:00
Juergen Hoeller 01b8d9327d AnnotationConfigWebApplicationContext allows for repeated register/scan calls
Restoring consistency with AnnotationConfigApplicationContext.

Issue: SPR-10852
2013-08-28 00:04:53 +02:00
Rob Winch 00bc54dcc5 Restore method signatures on MediaType
Previously the method signatures for includes and isCompatibleWith were
incompatible with Spring 3.2.x since the argument was now MimeType.
This caused NoSuchMethodError to be thrown when a class was compiled
against MediaType from Spring 3.2.x and ran against MediaType
from Spring 4.x.

This commit restores the signatures and implements each method by
invoking the super class method.

Issue: SPR-10860
2013-08-27 14:37:56 -05:00
Arjen Poutsma ebcee26d57 Add AsyncRestTemplate
Added AsyncRestTemplate, the asynchronous counterpart to the
RestTemplate that was introduced in Spring 3. All methods on the
AsyncRestTemplate are similar to those found on the synchronous
RestTemplatem, except that they return Future wrappers instead of
concrete results.

To enable this, this commit introduces the AsyncClientHttpRequest and
AsyncClientHttpRequestFactory, similar to the ClientHttpRequest and
ClientHttpRequestFactory, except that ClientHttpRequest returns a
Future<ClientHttpResponse> for the execute method. Two implementations
of these interfaces are provided, one based on the HttpURLConnection
incombination with a Spring AsyncTaskExecutor and one based on Apache
HttpComponents HttpAsyncClient.

Issue: SPR-8804
2013-08-27 14:22:37 -04:00
Gabriel Axel d66206704e Fix NPE in ResourceHttpMessageConverter
ResourceHttpMessageConverter tries to use the filename to determine the
media type, but for Resource implementations such as ByteArrayResource
it is null, which causes NullPointerException. The fix checks whether
getFilename returns null before attempting to determine the media type
by it.

Issue: SPR-10848
2013-08-22 16:05:44 -04:00
Dmitry Katsubo 47d40053a4 Add Jackson serialization inclusion to FactoryBean
Issue: SPR-10810
2013-08-22 16:05:44 -04:00
Rossen Stoyanchev 08d36cf2e4 Allow custom expand algorithm in UriComponents
Issue: SPR-10647
2013-08-22 16:05:44 -04:00
Rossen Stoyanchev 1fd7bc3ee5 Make MediaType serializable
Issue: SPR-8738
2013-08-22 16:05:44 -04:00
Rossen Stoyanchev 71dbd7bc1f Remove qetQueryParams from ServerHttpRequest 2013-08-14 11:43:37 -04:00
Rossen Stoyanchev 4c0490a070 Remove Cookie support from ServerHttpRequest
Although ServletHttpRequest provides access to Cookies, other
implementations may not. At the moment this was only needed
for SockJS to check the value of the JSESSIONID cookie. This
is now down by parsing the raw cookie values locally.

If comprehensive cookie support is to be added, we should
probably consider HttpHeaders as a potential candidate.
2013-08-14 10:15:02 -04:00
Dmitry Katsubo b232dc9d2b Add canRead/Write to MarshallingHttpMessageConverter
Issue: SPR-10463
2013-08-13 18:48:20 -04:00
Rossen Stoyanchev 01feae0ad5 Polish WebSocketSession
Update methods available on WebSocketSession interface.
Introduce DelegatingWebSocketSession interface.
2013-08-13 17:28:00 -04:00
Juergen Hoeller 1420b970a7 Introduced DefaultParameterNameDiscoverer which checks JDK 8's standard reflection first and then falls back to ASM-based debug symbol analysis
Also, StandardReflectionParameterNameDiscoverer calls "Parameter.isNamePresent()" now to return null (and pass on to the next discoverer) if no JDK 8 parameters are available. Note that this requires OpenJDK 8 b100 or higher to compile now.

Issue: SPR-10532
2013-08-08 15:52:43 +02:00
Rossen Stoyanchev ead0124b39 Fix bug that ignored custom json prefix
Issue: SPR-10817
2013-08-08 09:38:01 -04:00
Rossen Stoyanchev 82a26024ae Allow @ResponseBody on the type level
This change enables having @ResponseBody on the type-level in which
case it inherited and does not need to be added on the method level.

For added convenience, there is also a new @RestController annotation,
a meta-annotation in turn annotated with @Controller and @ResponseBody.
Classes with the new annotation do not need to have @ResponseBody
declared on the method level as it is inherited.

Issue: SPR-10814
2013-08-07 18:54:36 -04:00
Rossen Stoyanchev eb4579b4d4 Extract MimeType as a base class of MediaType
MimeType is available in core-spring and does not include support
for quality parameters and media used in HTTP content negotiation.
The MediaType sub-class in org.springframework.http adds q-parameters.
2013-08-07 13:21:37 -04:00
Arjen Poutsma 7576274874 Fix potential security risk when using Spring OXM
Disable by default external entity resolution when using Spring OXM
with jaxb. This prevents a XML entity from being able to resolve a
local file on the host system.

See:
https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing

Issue: SPR-10806
2013-08-06 15:08:53 -07:00
Sam Brannen cc2e7bb3d7 Polish AbstractContextLoaderInitializer and subclasses
This commit polishes the Javadoc and assertion failure messages for
AbstractContextLoaderInitializer and its subclasses.
2013-08-05 19:13:16 +02:00
Rossen Stoyanchev cb77440936 Make date methods in HttpHeaders public
Issue: SPR-10713
2013-08-05 12:37:18 -04:00
Rossen Stoyanchev 9245fffcaf Return -1 after parse error for Expires header
Issue: SPR-10648
2013-08-05 12:25:26 -04:00
Rossen Stoyanchev 123c01908a Remove unintended dependency on Servlet API in SockJS
Add a factory method in ServerHttpRequest for creating a
ServerHttpAsyncRequestControl.
2013-08-03 11:21:02 -04:00
Rossen Stoyanchev 15a2f03459 Polish SockJS exception handling and javadoc
See javadoc in SockJsService for details.

Also remove ReadOnlyMultiValueMap, CollectionUtils has a method for
that already.
2013-08-03 11:03:27 -04:00
Rossen Stoyanchev a03517fa35 Polish ServletServerHttpRequest query param handling
The method returning query parameters now returns only query string
parameters as opposed to any Servlet request parameter.

This commit also adds a ReadOnlyMultiValueMap.
2013-08-02 17:40:08 -04:00
Rossen Stoyanchev 9700f09fad Polish async feature for ServerHttpRequest/Response
ServerHttpAsyncResponseControl wraps a ServetHttpRequest and -Response
pair and allows putting the processing of the request in async mode
so that the response remains open until explicitly closed, either from
the current or from another thread.

ServletServerHttpAsyncResponseControl provides a Serlvet-based
implementation.
2013-08-02 15:12:20 -04:00
Rossen Stoyanchev 0d5901ffb6 Polish Cookie abstraction in http packge of spring-web
A getCookies method is now available on ServerHttpRequest with one
ServletServerCookie implementation that wraps a Servlet cookie.

The SockJS service makes use of this to check for an existing session
cookie in the request.
2013-08-02 12:30:43 -04:00
Juergen Hoeller c26272cef6 DelegatingFilterProxy avoids synchronization for pre-resolved delegate
Issue: SPR-10413
2013-08-02 18:17:13 +02:00
Juergen Hoeller 2af891683e Polishing
Issue: SPR-10752
Issue: SPR-10627
(cherry picked from commit ae0f23e)
2013-08-01 00:20:33 +02:00
Rossen Stoyanchev 803779d160 Support List<Part> method arguments
Issue: SPR-10591
2013-07-30 22:01:17 -04:00
Rossen Stoyanchev 4c991ba4d0 Make HTTP scheme parsing case-insensitive
Issue: SPR-10779
2013-07-30 12:30:21 -04:00
Juergen Hoeller 01a71ef5ef Polishing 2013-07-24 13:40:15 +02:00
Rossen Stoyanchev d0d670cd7d Make the JSON prefix used in converters configurable
Issue: SPR-10627
2013-07-19 17:22:58 -04:00
Rossen Stoyanchev 9af1984b39 Cache constructor instance in WebAsyncUtils
Issue: SPR-10673
2013-07-18 12:13:02 -04:00
Rossen Stoyanchev aa6f30482f Reverse change committed erroneously 2013-07-17 23:00:17 -04:00
Rossen Stoyanchev 3e53725896 Merge branch 'master' into websocket-stomp 2013-07-17 22:43:30 -04:00
Rossen Stoyanchev 078cfb3e78 Add @ReplyTo/@ReplyToUser, remove deps on spring-web 2013-07-16 22:07:46 -04:00
Arjen Poutsma 14ab2c88cc Request streaming for Apache HttpClient
- Added org.springframework.http.StreamingHttpOutputMessage, which
  allows for a settable request body (as opposed to an output stream).

- Added http.client.HttpComponentsStreamingClientHttpRequest, which
  implements the above mentioned interface, mapping setBody() to a
  setEntity() call on the Apache HttpClient HttpEntityEnclosingRequest.

- Added a 'bufferRequestBody' property to the
  HttpComponentsClientHttpRequestFactory. When this property is set to
  false (default is true), we return a
  HttpComponentsStreamingClientHttpRequest instead of a (request
  buffering) HttpComponentsClientHttpRequest.

Issue: SPR-10728
2013-07-11 09:46:14 -04:00
Rossen Stoyanchev d650e909b2 Merge branch 'master' into websocket-stomp 2013-06-27 15:58:12 -04:00
Phillip Webb 2d018e5019 Polish @RequestMapping Javadoc
Issue: SPR-10587
2013-06-26 11:15:54 -07:00
Phillip Webb 38c2f253ed 'Rename' HttpHeaders.getIfNotModifiedSince()
Effectively rename HttpHeaders.getIfNotModifiedSince() to
getIfModifiedSince() by adding a new method and deprecating the
old one.

Issue: SPR-10600
2013-06-26 10:44:35 -07:00
Rossen Stoyanchev c6ecaacc03 Add getResult/hasResult methods to DeferredResult
Issue: SPR-10603
2013-06-20 20:57:24 -04:00
Rossen Stoyanchev 2d8315fba0 Reverse SPR-10402 change that caused 3.2.3 regression
SPR-10402 in Spring Framework 3.2.3 treated empty request parameter
values as missing values, if the empty value was turned into a null
by a PropertyEditor or Converter. This caused the regression.

Issue: SPR-10578, SPR-10402, SPR-10584
2013-06-20 16:20:01 -04:00
Rossen Stoyanchev 55a212d4a0 Add @MessageExceptionHandler
Similar to @ExceptionHandler but for message processing. Such a method
can send messages to both the message broker channel and the client
channel provided the client is subscribed to the target destination.
2013-06-19 22:17:59 -04:00
Sam Brannen f311bf3daf Introduce TCP & UDP server port scanning utility
Prior to this commit the Spring Framework did not provide a public means
for scanning for available server ports. However, the Spring Framework
internally used a FreePortScanner in integration tests within its own
test suite. Furthermore, Spring Integration 2.2 provides similar support
in a SocketUtils class in the spring-integration-test module.

This commit introduces SocketUtils in spring-core to replace the
FreePortScanner which was previously only used internally within
Spring's test suite. This new implementation is inspired by both Spring
Framework's FreePortScanner and Spring Integration's SocketUtils and
consequently attempts to merge the best of both previous
implementations.

Issue: SPR-8032
2013-06-15 13:46:32 +02:00
Juergen Hoeller a19c976f7f Avoid NPE in ContextLoader when dealing with an untyped ApplicationContextInitializer
Issue: SPR-10449
2013-05-16 16:09:54 +02:00
Juergen Hoeller cd3d0c35c3 Replaced Map synchronization with ConcurrentHashMap to avoid session access deadlocks
Issue: SPR-10436
2013-05-16 14:33:14 +02:00
Rossen Stoyanchev a86283eb28 Make removal of jsessionid case insensitive
Issue: SPR-10398
2013-05-14 22:06:59 -04:00
Rossen Stoyanchev db596d23de Fix deadlock issue in DeferredResult
Previously DeferredResult locked around the setting of the result
including handling up to the part of submitting a dispatch. This
can cause a deadlock if a timeout occurs at the same time since
the Tomcat timeout thread has its own locking that permits only
one thread to do timeout or dispatch processing.

The fix reduces the locking to cover only the attempt to set the
DeferredResult but not the dispatching.

Issue: SPR-10485
2013-05-14 17:01:46 -04:00
Rossen Stoyanchev 05084d504b Add spring-websocket module tests 2013-05-14 13:59:15 -04: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
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 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 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
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
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
Rossen Stoyanchev e7f38e5b17 Merge branch 'websocket' 2013-05-06 14:46:29 -04:00
Rossen Stoyanchev 7845ebc428 Add SockJS path detection 2013-05-05 20:51:37 -04:00
Juergen Hoeller 532de1a259 Polishing 2013-05-03 13:45:56 +02:00
Juergen Hoeller c3b624df29 Polished UriComponents implementation 2013-05-03 13:22:11 +02:00
Juergen Hoeller f4b97c26df Removed UriTemplate's unused encodeUri template method 2013-05-03 13:02:19 +02:00
Rossen Stoyanchev 2a7935a913 Add WebSocketSession attributes + initialization
In addition to adding the attributes, there is now mechanism for
initializing WebSocketSession instances from attributes of the
handshake request.
2013-05-02 13:47:18 -04:00
Juergen Hoeller 0a8f5b2919 Removed deprecated helper classes and methods (that have been deprecated since 3.0 or before) 2013-05-02 17:25:10 +02:00
Juergen Hoeller 17610c2523 Added note on non-thread-safety of Jackson's DateFormat support 2013-05-02 16:09:30 +02:00
Juergen Hoeller 767bd3f3f8 Upgraded to Jackson 1.9 (raising minimum to 1.8+) and 2.2 2013-05-02 15:51:59 +02:00
Juergen Hoeller 1295c6f340 Upgraded to Hessian 4.0.7; deprecated Burlap support 2013-04-30 15:13:23 +02:00
Juergen Hoeller 9c09a0a037 Consistent Map/Set ordering
Use LinkedHashMaps/Sets wherever exposed to users, and code tests defensively in terms of expected Map/Set ordering. Otherwise, there'll be runtime order differences between JDK 7 and JDK 8 due to internal HashMap/Set implementation differences.

Issue: SPR-9639
2013-04-23 13:53:09 +02:00
Rossen Stoyanchev 3a2c15b0fd Add flush method to ServerHttpResponse
This is useful to make sure response headers are written to the
underlying response. It is also useful in conjunction with long
running, async requests and HTTP streaming, to ensure the Servlet
response buffer is sent to the client without additional delay and
also causes an IOException to be raised if the client has gone away.
2013-04-15 11:03:24 -04:00
Rossen Stoyanchev 6bd6311214 Refactor SockJS code
- configure SockJS handler by type (as well as by instance)
- add method to obtain SockJS handler instance via SockJsConfiguration
- detect presense of jsr-356 and use it if available
2013-04-15 11:03:24 -04:00
Rossen Stoyanchev 88447e503b Add first cut of SockJS server support 2013-04-15 11:03:24 -04:00
Rossen Stoyanchev cdd7d7bd88 Add javax.websocket.Endpoint configuration support 2013-04-15 11:03:24 -04:00
Juergen Hoeller 6d710563cc Upgraded to Commons FileUpload 1.3 and JSF 2.1, removing deprecated JSF 1.1 VariableResolvers 2013-03-29 22:51:42 +01:00
Juergen Hoeller 15441da969 Removed Apache Commons HttpClient support (superseded by Apache HttpComponents) 2013-03-29 15:03:55 +01:00
Juergen Hoeller 853826a774 Use JDK 1.6's Collections.newSetFromMap instead of manually accessing Maps with dummy Boolean values 2013-03-28 22:14:26 +01:00
Juergen Hoeller deba32cad9 Upgraded all Servlet API mocks to Servlet 3.0 (with a little bit of Servlet 3.1 support in MockHttpServletResponse) 2013-03-20 17:19:34 +01:00
Juergen Hoeller bb14c16938 Revised WebServiceFeature handling: requiring JAX-WS 2.1+, including support for JAX-WS 2.2 service-level features now 2013-03-20 12:20:46 +01:00
Juergen Hoeller 20fb418785 Removed Spring’s own JSP expression support (in favor of JSP 2.0+) 2013-03-19 16:30:46 +01:00
Juergen Hoeller f1258a6a02 Removed JAX-RPC support 2013-03-19 15:00:17 +01:00
Juergen Hoeller a03d125b4e Removed Servlet 2.4 forward attribute support in InternalResourceView and TilesView 2013-03-19 14:33:21 +01:00
Phillip Webb 4e1cab28df Merge branch '3.2.x'
* 3.2.x: (28 commits)
  Hide 'doc' changes from jdiff reports
  Document @Bean 'lite' mode vs @Configuration
  Final preparations for 3.2.2
  Remove Tiles 3 configuration method
  Polishing
  Extracted buildRequestAttributes template method from FrameworkServlet
  Added "beforeExistingAdvisors" flag to AbstractAdvisingBeanPostProcessor
  Minor refinements along the way of researching static CGLIB callbacks
  Compare Kind references before checking log levels
  Polish Javadoc in RequestAttributes
  Fix copy-n-paste errors in NativeWebRequest
  Fix issue with restoring included attributes
  Add additional test for daylight savings glitch
  Document context hierarchy support in the TCF
  Fix test for daylight savings glitch
  Make the methodParameter field of HandlerMethod final
  Disable AsyncTests in spring-test-mvc
  Reformat the testing chapter
  Document context hierarchy support in the TCF
  Document context hierarchy support in the TCF
  ...
2013-03-13 14:01:46 -07:00
Sam Brannen 12db873002 Polish Javadoc in RequestAttributes 2013-03-13 14:11:08 +01:00