Commit Graph

10644 Commits

Author SHA1 Message Date
Sam Brannen 49aabd5ac2 Polish Javadoc for (Synthesizing)MethodParameter 2015-06-30 00:30:42 +02:00
Juergen Hoeller dc1f921f5c Split between basic MethodParameter and SynthesizingMethodParameter
This split avoids a package tangle (between core and core.annotation) and also allows for selective use of raw annotation exposure versus synthesized annotations, with the latter primarily applicable to web and message handler processing at this point.

Issue: SPR-13153
2015-06-30 00:02:02 +02:00
Juergen Hoeller 26acb4887d YamlProcessor explicitly closes UnicodeReader
Issue: SPR-13173
2015-06-29 23:47:37 +02:00
Sam Brannen 7c94c699df Use annotation attribute aliases in examples
This commit updates examples in the reference manual to use annotation
attribute aliases.
2015-06-29 17:21:29 +02:00
Sam Brannen 595f9bfc41 Polish attribute alias examples in "what's new" 2015-06-29 17:07:48 +02:00
Sam Brannen 110ccaa721 Use annotation attribute aliases in examples
This commit updates examples in the reference manual to use annotation
attribute aliases.
2015-06-29 16:54:45 +02:00
Sam Brannen a7d8103d64 Polish CORS documentation in the reference manual 2015-06-29 16:54:44 +02:00
Brian Clozel 39d689da0c Fix conditional requests support for HttpEntity
Prior to this commit, `HttpEntityMethodProcessor` would rely on
`ServletWebRequest` to process conditional requests and with incoming
`"If-Modified-Since"` / `"If-None-Match"` request headers.

This approach is problematic since in that class:

* response is wrapped in a `ServletServerHttpResponse`
* this wrapped response does not write response headers right away
* `ServletWebRequest.checkNotModified` methods can't apply their
logic with incomplete response headers

This solution adds some minimal code duplication and applies
the conditional request logic within the Processor.

A possible alternative would be to improve the
`ServletServerHttpResponse$ServletResponseHttpHeaders` implementation
with write methods - but this solution would only work for Servlet 3.x
applications.

Issue: SPR-13090
2015-06-29 16:47:27 +02:00
Sebastien Deleuze 338a18ef99 Polish Web Improvements section 2015-06-29 16:37:58 +02:00
Sam Brannen 42424d6359 Document XML attributes in mvc:resource-chain in 4.1 XSD
Issue: SPR-12804
2015-06-29 16:21:32 +02:00
Sebastien Deleuze b439402d57 Add CORS section to the ref doc 2015-06-29 16:02:58 +02:00
Sam Brannen c9b26d80e1 Polish resource chain documentation 2015-06-29 15:57:58 +02:00
Brian Clozel c61552b258 Document XML attributes in mvc:resource-chain
Issue: SPR-12804
2015-06-29 15:32:29 +02:00
Sebastien Deleuze e0d0fc53a9 Update new features section in the reference doc 2015-06-29 11:31:10 +02:00
Sam Brannen 63a1348c32 Polish LoggingResultHandler in Spring MVC Test
Issue: SPR-13171
2015-06-27 22:44:42 +02:00
Sam Brannen 693dcba867 Introduce LoggingResultHandler in Spring MVC Test
Prior to this commit, the Spring MVC Test framework only provided
support for printing debug information about the MvcResult to STDOUT.

This commit introduces support for logging `MvcResult` details at
`DEBUG` level via the Apache Commons Logging API. In addition, this
commit introduces additional `print(..)` variants for printing debug
information to custom output streams and writers.

Specifically, `MockMvcResultHandlers` has been augmented with the
following new static methods:

 - `log()`
 - `print(OutputStream)`
 - `print(Writer)`

Issue: SPR-13171
2015-06-27 21:53:19 +02:00
Sam Brannen 895d43a2b3 Print cookies in human-readable form in Spring MVC Test
Prior to this commit, when rendering cookies via `andDo(print())` in
Spring MVC Test, the output for the `MockHttpServletResponse` would
look something like the following:

  Cookies = [javax.servlet.http.Cookie@25084a1e]

The reason is that the Cookie class in javax.servlet-api-3.0.1.jar does
not implement toString(). Consequently, nothing about the cookie's
name, value, etc., is displayed, thereby making the debug output for
cookies next to useless.

This commit improves on this by implementing custom toString() logic
for cookies in debug output in Spring MVC Test. For example, the output
now looks like this (without the newlines):

  Cookies = [[Cookie@47faa49c name = 'enigma', value = '42', \\
            comment = [null], domain = [null], maxAge = -1, \\
            path = [null], secure = false, version = 0, \\
            httpOnly = false]]

In addition, this commit fixes a minor bug for FlashMap debug output if
the FlashMap is empty.

Issue: SPR-13168
2015-06-27 02:54:42 +02:00
Juergen Hoeller a2d3c27ed1 Allow MVC handler methods to return any CharSequence type as view name
Issue: SPR-13165
2015-06-26 22:17:53 +02:00
Juergen Hoeller a5349eb2f8 Base64Utils falls back to JAXB DatatypeConverter for String-based encoding
Issue: SPR-12938
2015-06-26 22:06:13 +02:00
Brian Clozel 5b47504dd4 Document XsltView in reference doc
And delete all references to the deprecated AbstractXsltView.

Issue: SPR-6599
2015-06-26 18:51:15 +02:00
Sam Brannen 8416752645 Polish Javadoc for MVC parameter binding annotations 2015-06-26 16:14:06 +02:00
Sam Brannen 34204d27f3 Merge pull request #828 from Youmoo/Youmoo-patch-1
* Youmoo-Youmoo-patch-1:
  Fix BeanWrapperImpl example code in ref. manual
2015-06-26 15:52:31 +02:00
youmoo 8d06b06a9b Fix BeanWrapperImpl example code in ref. manual 2015-06-26 15:49:03 +02:00
Brian Clozel 776716087c Merge pull request #827 from Youmoo/Youmoo-patch-1
fix typo in reference documentation
2015-06-26 11:59:14 +02:00
Brian Clozel ba48d6489f Mention Groovy Markup Templates in ref doc
Add a section on Groovy Markup Template support and
reorder sections in the View Technologies chapter, to have in order:

* Thymeleaf
* Groovy Markup Template
* Velocity and Freemarker
* JSPs
* Script Templates
* other views...

Issue: SPR-12829
2015-06-26 10:14:30 +02:00
Brian Clozel e72b821a73 Mention WebJarsResourceResolver in ref doc
Issue: SPR-12323
2015-06-26 10:14:30 +02:00
youmoo 2fe6dddbf3 fix typo 2015-06-26 16:04:14 +08:00
Sebastien Deleuze 89cc8e0401 Restore compatibility with Jackson 2.1
Issue: SPR-12501
2015-06-26 02:18:29 +02:00
Sebastien Deleuze 3bff7bd895 Serialize with type only with jackson 2.6+
Previous Jackson versions do not serialize polymorphic collections correctly
when the type is specified.

Issue: SPR-12811
2015-06-26 02:15:37 +02:00
Rossen Stoyanchev b542b52775 Update Javadoc on AntPathMatcher 2015-06-25 09:41:59 -04:00
Rossen Stoyanchev 6842fd7fb9 Ensure result ready in asyncDispatch in MockMvc
Issue: SPR-13079
2015-06-25 09:25:21 -04:00
Sebastien Deleuze 289f35da3a Call type aware canWrite() when using a GenericHttpMessageConverter
This commit introduces the following changes:
 - In AbstractMessageConverterMethodProcessor, the type aware variant of
   canWrite() is now called when the converter implements
   GenericHttpMessageConverter.
 - The Javadoc has been updated in GenericHttpMessageConverter to make it clear
   that the type aware canRead() and canWrite() methods should perform the same
   checks than non type aware ones.
  - AbstractGenericHttpMessageConverter now implements default type aware
    canRead() and canWrite() methods than just call the non type aware variants.
    Due to this, if subclasses just override the non type aware variants,
    they still have the right behavior.

Issue: SPR-13161
2015-06-25 15:02:33 +02:00
Sam Brannen 51e30dd221 Polish MimeType 2015-06-24 23:59:22 +02:00
Sam Brannen e8c8d2a6ad Refactor WebSocket int. tests to work w/ Jetty 9.3
Recent builds of Jetty 9.3 require that Jetty's own ServletContext
implementation be supplied to WebSocketServerFactory's init() method.
Otherwise, the Jetty server will fail to start with the exception
message: "Not running on Jetty, WebSocket support unavailable".

This commit refactors AbstractWebSocketIntegrationTests,
AbstractSockJsIntegrationTests, and all WebSocketTestServer
implementations in order to support this new requirement.

Specifically:

- WebSocketTestServer defines a new getServletContext() method;
  TomcatWebSocketTestServer, UndertowTestServer, and
  JettyWebSocketTestServer have all been updated to return the
  ServletContext created by the embedded server.

- The setup() methods in AbstractWebSocketIntegrationTests and
  AbstractSockJsIntegrationTests have been updated so that the
  WebApplicationContext is supplied the appropriate ServletContext,
  after deployConfig() has been invoked on the WebSocketTestServer but
  before the WebApplicationContext is refreshed.

Issue: SPR-13162
2015-06-24 20:16:25 +02:00
Rossen Stoyanchev 8b50750511 Fix failure in performance build
The JettySockJsIntegrationTests are enabled in the performance build
only. Following the upgrade to Jetty 9.3 where the
JettyRequestUpgradeStrategy is now Lifecycle as wel as
ServletContextAware, we need to make sure the ApplicationContext
refresh occurs after the ServletContext has been set. This change
removes the explicit .refresh() call in the test setup and instead
relies on the DispatcherServlet to do that, which ensures that the
ServletContext with which it is initialized by Jetty has been set
on the ApplicationContext before that.
2015-06-24 10:46:45 -04:00
Brian Clozel 7df9679399 Dependency upgrade webjars-locator 0.26 2015-06-24 16:13:29 +02:00
Stephane Nicoll d32216a047 Add reference to Order for event listeners 2015-06-24 15:29:07 +02:00
Brian Clozel 0417b89a9d Dependency update: Netty 4.0.29.Final 2015-06-24 11:08:10 +02:00
Sam Brannen 89e504c2f1 Uses Charset instead of String in MimeType.equals()
Prior to this commit, Spring's MimeType checked for equality between
two MIME types based on the equality of their properties maps; however,
the properties maps contain string representations of the "charset"
values. Thus, "UTF-8" is never equal to "utf-8" which breaks the
contract for character set names which must be compared in a
case-insensitive manner.

This commit addresses this issue by ensuring that "charset" properties
in MimeType instances are compared as Java Charset instances, thereby
ignoring case when checking for equality between charset names.

Issue: SPR-13157
2015-06-23 22:30:25 +02:00
Sam Brannen f2f58f1677 Polish Javadoc in MimeType 2015-06-23 21:26:50 +02:00
Sam Brannen 10a691bd51 Support inlined SQL statements in @Sql
Prior to this commit, it was only possible to declare SQL statements
via @Sql within external script resources (i.e., classpath or file
system resources); however, many developers have inquired about the
ability to inline SQL statements with @Sql analogous to the support for
inlined properties in @TestPropertySource.

This commit introduces support for declaring _inlined SQL statements_
in `@Sql` via a new `statements` attribute. Inlined statements are
executed after statements in scripts.

Issue: SPR-13159
2015-06-23 20:45:00 +02:00
Sam Brannen 3da59178e5 Document attribute alias support in AnnotationUtils 2015-06-23 18:38:00 +02:00
Sam Brannen 2451594cdd Synthesize annotation arrays within AnnotationUtils
Issue: SPR-11393
2015-06-23 18:30:47 +02:00
Sam Brannen 75fe61843a Fix broken (Async)RestTemplate integration tests
Issue: SPR-13157
2015-06-23 15:15:09 +02:00
Rossen Stoyanchev e083683f4f Update WebSocket support for Jetty 9.3
Issue: SPR-13140
2015-06-22 22:30:44 -04:00
Rossen Stoyanchev 25ff34f3c7 JettyRequestUpgradeStrategy implements Lifecycle
After this change JettyRequestUpgradeStrategy implements Lifecyle,
which is used to init and cleanup the Jetty WebSocketServerFactory.

Since a RequestUpgradeStrategy is typically created reflectively
within DefaultHandshakeHandler, the Lifecycle events are propagated
from the top, i.e. the Spring MVC HandlerMapping through the
WebSocket/SockJsHttpRequestHandler.

Issue: SPR-13140
2015-06-22 22:30:44 -04:00
Rossen Stoyanchev b6b76ad1b4 Polish WebMvcStompEndpointRegistry 2015-06-22 22:30:44 -04:00
Rossen Stoyanchev d1cc8bac5c Add config option for StompSubProtocolErrorHandler
Issue: SPR-13142
2015-06-22 22:30:44 -04:00
Sebastien Deleuze 31a5434ea4 Make @ResponseBody method return type available for message converters
This commit adds canWrite() and write() methods to the
GenericHttpMessageConverter interface. These are type aware variants
of the methods available in HttpMessageConverter, in order to keep
parametrized type information when serializing objects.

AbstractMessageConverterMethodProcessor now calls those type aware
methods when the message converter implements GenericHttpMessageConverter.

AbstractJackson2HttpMessageConverter and GsonHttpMessageConverter uses
these new methods to make @ResponseBody method return type available
for type resolution instead of just letting the JSON serializer trying
to guess the type to use from the object to serialize.

Issue: SPR-12811
2015-06-22 17:05:45 +02:00
Stephane Nicoll 04a7ed5f91 Update release note for @JmsListeners 2015-06-22 13:13:16 +02:00