Commit Graph

225 Commits

Author SHA1 Message Date
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
Sam Brannen bf6ee1631c Fix copy-n-paste errors in NativeWebRequest 2013-03-13 13:00:57 +01:00
Rossen Stoyanchev 8ab8e4f7c2 Make the methodParameter field of HandlerMethod final
Previously the methodParameter array field was initialized lazily since
it requires reflection. However, in practice the field is always used
and there is not much benefit from the lazy initialization.

In Spring Framework 3.2, the methodParameter field was copied when a
new HandlerMethod instance (with the resolved bean) is created for
performance reasons. That introduced a synchronization issue since
the lazy initialization was not synchronized.

Issue: SPR-10365
2013-03-10 12:54:03 -04:00
Oliver Gierke 3eb3610660 UriComponentsBuilder parse of empty fragments
Check for an empty fragment in UriComponentsBuilder.fromUriString(...)
to prevent the invocation of fragment(...).

Previously, UriComponentsBuilder.fromUriString(...) threw an exception
in the case of an empty fragment being provided (e.g. /example#).

Issue: SPR-10363
2013-03-08 22:15:26 -08:00
Rossen Stoyanchev 8e4e0f3531 Use null in MockServletContext for unknown mime types
MockServletContext.getMimeTypes now returns null if the Java Activation
Framework returns "application/octet-stream", which is the default
media type it returns if the mime type is unknown. This enforces the
contract for ServletContext.getMimeTypes (return null for uknown mime
types) but does mean "application/octet-stream" cannot be returned.

Issue: SPR-10334
2013-03-07 12:33:44 -05:00
Phillip Webb 05765d7520 Replace EasyMock with Mockito
Issue: SPR-10126
2013-03-06 11:06:15 -08:00
Chris Beams ce4be3b46b Merge branch '3.2.x' into master
Conflicts:
	gradle.properties
	spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java
	spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheManagerFactoryBean.java
	spring-core/src/main/java/org/springframework/core/convert/support/StringToEnumConverterFactory.java
	spring-core/src/main/java/org/springframework/core/env/ReadOnlySystemAttributesMap.java
	spring-jdbc/src/main/java/org/springframework/jdbc/datasource/LazyConnectionDataSourceProxy.java
	spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/AbstractLobHandler.java
	spring-web/src/main/java/org/springframework/http/client/BufferingClientHttpRequestWrapper.java
	spring-web/src/main/java/org/springframework/http/client/SimpleBufferingClientHttpRequest.java
	spring-web/src/main/java/org/springframework/http/converter/BufferedImageHttpMessageConverter.java
	spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java
2013-03-04 15:41:15 +01:00
Rossen Stoyanchev 3abe05c65e Update @RequestParam javadoc
Issue: SPR-10180
2013-03-01 16:30:02 -05:00
Chris Beams 0e8c950f7d Re-enable JaxWsSupportTests
These tests still fail under Eclipse for unknown reasons, but do work
under Gradle, so are thus re-enabled by removing the @Ignore.

Issue: SPR-10074
2013-02-26 14:26:32 +01:00
Phillip Webb e2e4cbe6b3 Deprecate HttpStatus.MOVED_TEMPORARILY
Deprecate HttpStatus.MOVED_TEMPORARILY in favor of HttpStatus.FOUND
since HttpStatus.valueOf(302) will always return FOUND.

The name of the 302 status code was changed between HTTP 1.0 and
HTTP 1.1 but the underlying meaning remains the same.

Issue: SPR-10300
2013-02-25 11:56:57 -08:00
Phillip Webb 5b7969e726 Fix UriComponents.equals() method
Fix HierarchicalUriComponents and OpaqueUriComponents .equals() methods.

Issue: SPR-10313
2013-02-19 13:19:42 -08:00
Rossen Stoyanchev 5b1165b102 Ignore path parameters in request mappings
Before this change the presence of path params (e.g. "/foo;q=1/bar")
expected the request mapping to contain a URI variable in the place of
semicolon content (e.g. either "/{foo}/bar" or "/{foo};{fooParams}").

The change ensures path params are ignored in @RequestMapping patterns
so that "/foo/bar" matches to "/foo;q=1/bar" as well as
"/foo;q=1;p=2/bar".

Along with this change, the RequestMappingHandlerMapping no longer
defaults to having semicolon content removed from the URL, which means
@MatrixVariable is supported by default without the need for any
further configuration.

Issue: SPR-10234
2013-02-15 11:31:32 -05:00
Juergen Hoeller ff15534211 Log4jWebConfigurer supports resolving placeholders against ServletContext init-parameters as well
Introducing a ServletContextPropertyUtils helper (analogous to SystemPropertyUtils) along the way.

Issue: SPR-10284
2013-02-15 13:32:44 +01:00
Rossen Stoyanchev 221562dbeb Use default value for empty values in @RequestParam
Issue: SPR-10180
2013-02-15 07:25:26 -05:00
Rossen Stoyanchev f5c9fe69a4 Update JavaScriptUtils
Add escaping for <, >, and PS/LS line terminators

Issue: SPR-9983
2013-02-15 06:38:40 -05:00
Phillip Webb 6e5cb7fbcd Protect against '//' in UriComponentsBuilder
Refactor UriComponentsBuilder to ensure that paths do not contain empty
segments.

For example, prior to this commit:

    fromUriString("http://example.com/abc/").path("/x/y/z")

would build the URL "http://example.com/abc//x/y/z" where as it will
now build "http://example.com/abc/x/y/z".

Issue: SPR-10270
2013-02-14 21:10:23 -08:00
Phillip Webb 92ad66bf10 Add setOutputStreaming option for HTTP factory
Add setOutputStreaming on SimpleClientHttpRequestFactory to allow the
disabling of 'output streaming' mode on the underlying connection so
that authentication and redirection can be handled automatically.

Issue: SPR-9617
2013-02-13 11:52:23 -08:00
Phillip Webb 6661788748 Ensure HTTP classes don't close streams
Prior to this commit several HTTP classes made use of FileCopyUtils
when reading from or writing to streams. This has the unfortunate
side effect of closing streams that should really be left open.

The problem is particularly noticeable when dealing with a
FormHttpMessageConverter that is writing a multi-part response.

Relevant HTTP classes have now been refactored to make use of a new
StreamUtils class that works in a similar way FileCopyUtils but does
not close streams.

The NonClosingOutputStream class from SimpleStreamingClientHttpRequest
has also been refactored to a StreamUtils method.

Issue: SPR-10095
2013-02-11 19:04:53 -08:00
Phillip Webb 2ca75386f1 Align UriComponents.toUri() with toUriString()
Update HierarchicalUriComponents.toUri() to only prepend a missing '/'
when the scheme, user info, host or port are specified. This makes
the toUri() method behave in the same way as .toUriString() and allows
relative URIs to be created.

Issue: SPR-10231
2013-02-11 12:14:06 -08:00
Phillip Webb 203b22b246 UriComponentsBuilder supports query without value
Fix UriComponentsBuilder to support query parameters that do not
include a value without losing '='. The following styles are now
supported:

    http://example.com/foo?bar=baz
    http://example.com/foo?bar=
    http://example.com/foo?bar

Issue: SPR-10215
2013-02-11 12:13:54 -08:00
Phillip Webb f32ce3a613 Make HierarchicalUriComponents Serializable
(fix apache header copyright dates)

Issue: SPR-10266
2013-02-11 09:25:30 -08:00
Phillip Webb 536325bc75 Make HierarchicalUriComponents Serializable
Issue: SPR-10266
2013-02-11 09:18:57 -08:00
Juergen Hoeller c6cf911931 Marked spring-web module as 'distributable' in order for session replication to work on Tomcat
Issue: SPR-10219
2013-02-06 21:44:34 +01:00
Juergen Hoeller ab3aa6c8c2 Added ContentNegotiationManager(Collection<ContentNegotiationStrategy>) constructor 2013-02-06 21:01:50 +01:00
Phillip Webb f464a45ba4 Polish formatting
Minor formatting polish across that codebase. Primarily fixing
whitespace issues.
2013-02-04 10:35:25 -08:00
Phillip Webb aac6b913d6 Merge branch 'cleanup-3.2.x' into 3.2.x
* cleanup-3.2.x:
  Fix unnecessary @SupressWarnings annotations
  Fix Javadoc warnings
  Fix unused local variable warnings
  Fix unused type compiler warnings
  Fix 'is already an instance of type' warnings
2013-01-31 12:52:51 -08:00
Juergen Hoeller 58f59d6851 MediaType throws dedicated InvalidMediaTypeException instead of generic IllegalArgumentException
Issue: SPR-10226
2013-01-30 14:58:36 +01:00
Phillip Webb d89e30b864 Fix unnecessary @SupressWarnings annotations 2013-01-29 15:37:25 -08:00
Phillip Webb 2b0d860923 Fix Javadoc warnings 2013-01-25 17:31:33 -08:00
Phillip Webb 065b1c0e46 Fix unused local variable warnings 2013-01-25 14:35:19 -08:00
Phillip Webb 6a1e841952 Fix unused type compiler warnings 2013-01-25 14:35:07 -08:00
Rossen Stoyanchev 2ee70d683d Suppress serialization warning 2013-01-23 15:00:14 -05:00
Rossen Stoyanchev 9982b4c01a Add BS and VT char escape sequences to JavaScriptUtils
Issue: SPR-9983
2013-01-23 13:37:17 -05:00
Juergen Hoeller 5a773b771d MockHttpServletResponse's getHeaderNames declares Collection instead of Set for Servlet 3.0 compatibility
Issue: SPR-9885
2013-01-22 21:12:03 +01:00
Juergen Hoeller c1a4f5c0fe MockHttpServletRequest's getParameter(Values) returns null for null parameter name
Issue: SPR-10192
2013-01-22 21:12:02 +01:00
Rossen Stoyanchev 40ed4e78be Make UriComponents Serializable
Issue: SPR-10186
2013-01-22 11:54:31 -05:00
Sam Brannen 2a41de00e3 Polish Javadoc in Spring MVC async support
This commit fixes some typographical and grammatical errors in various
classes in Spring MVC's async support.
2013-01-22 12:09:00 +01:00
Chris Beams 3cdb866bda Relax ConfigurableWebEnvironment signatures
ConfigurableWebEnvironment was introduced in 3.2.0.M1 with SPR-9439 in
order to break a cyclic dependency. At the same time, certain signatures
such as AbstractRefreshableWebApplicationContext#getEnviroment and
GenericWebApplicationContext#getEnvironment were updated to take
advantage of covariant return types and return this newer, more narrow
type and providing cast-free calls to ConfigurableWebEnvironment methods
where necessary. Similar changes were made to HttpServletBean in
3.2.0.M2 with SPR-9763.

Narrowing #getEnvironment signatures in this fashion required enforcing
at the #setEnvironment level that any Environment instance provided
(explicitly or via the EnvironmentAware callback) must be an instance of
ConfigurableWebEnvironment. This is a reasonable assertion in typical
web application scenarios, but as SPR-10138 demonstrates, there are
valid use cases in which one may want or need to inject a non-web
ConfigurableEnvironment variant, e.g. during automated unit/integration
testing.

On review, it was never strictly necessary to narrow #getEnvironment
signatures, although doing so did provided convenience and type safety.
In order to maintain as flexible and backward-compatible an arrangement
as possible, this commit relaxes these #getEnvironment signatures back
to their original, pre-3.2 state. Namely, they now return
ConfigurableEnvironment as opposed to ConfigurableWebEnvironment, and in
accordance, all instanceof assertions have been removed or relaxed to
ensure that injected Environment instances are of type
ConfigurableEnvironment.

These changes have been verified against David Winterfeldt's Spring by
Example spring-rest-services project, as described at SPR-10138.

Issue: SPR-10138, SPR-9763, SPR-9439
2013-01-22 11:33:37 +01:00
Rossen Stoyanchev 0c56e86bfb Fix NPE in FormHttpMessageConverter
Issue: SPR-10187
2013-01-21 14:09:32 -05:00
Juergen Hoeller 701c5f1110 ContextLoader properly detects pre-refreshed WebApplicationContext
Issue: SPR-9996
2013-01-18 15:20:55 +01:00
Sam Brannen 2427391286 Polish Javadoc in CookieValue and RequestHeader 2013-01-10 17:33:59 +01:00
Chris Beams 0829cbfdd3 Update license header for recently modified files
Issue: SPR-7763, SPR-10140, SPR-10132, SPR-10093, SPR-10103
2013-01-08 16:23:46 +01:00
Rossen Stoyanchev 87109b348c Add decoding matrix variable values
Issue: SPR-10140
2013-01-08 10:01:51 -05:00
Rossen Stoyanchev 2391277115 Fix issue in BufferedImageHttpMessageConverter
This change ensures BufferedImageHttpMessageConverter writes when
"*/*" is requested.

Issue: SPR-7763
2013-01-08 10:01:51 -05:00
Rossen Stoyanchev 7bc9667913 Add support for placeholders in @RequestMapping
@RequestMapping annotations now support ${...} placeholders.

Issue: SPR-9935
2013-01-07 18:06:47 -05:00
Phillip Webb 15c0971381 Merge branch 'cleanup-3.2.x' into 3.2.x
* cleanup-3.2.x:
  Gradle 'api' task depends on 'jar' tasks
  Mark all IsFastEnough tests as performance tests
2013-01-07 14:10:23 -08:00
Chris Beams ad1fda59c3 Merge branch 'SPR-9984' into cleanup-3.2.x
* SPR-9984:
  Mark all IsFastEnough tests as performance tests
2013-01-07 12:04:23 +01:00
Stevo Slavic 4c0a306943 Mark all IsFastEnough tests as performance tests
This patch marks remaining/missed tests as ones belonging to
performance tests group.

Issue: SPR-9984
2013-01-07 11:58:18 +01:00