Commit Graph

534 Commits

Author SHA1 Message Date
Juergen Hoeller a05b748d42 InternalResourceViewResolver's exposure of context beans is now available at UrlBasedViewResolver level
Issue: SPR-8064
2014-08-10 00:54:42 +02:00
Juergen Hoeller ad475ffadf Consistent vararg declarations for String array setters 2014-08-08 17:17:09 +02:00
Juergen Hoeller 3a419872c8 Polishing 2014-08-07 23:06:08 +02:00
Sebastien Deleuze 3922f6fc53 Update references to RFC 2616
Replace references to the old RFC 2616 (HTTP 1.1) with references
to the new RFCs 7230 to 7235.

This commit also deprecates:
 - HttpStatus.USE_PROXY
 - HttpStatus.REQUEST_ENTITY_TOO_LARGE in favor of HttpStatus.PAYLOAD_TOO_LARGE
 - HttpStatus.REQUEST_URI_TOO_LONG in favor of HttpStatus.URI_TOO_LONG

Issue: SPR-12067
2014-08-07 14:50:45 +02:00
Stephane Nicoll 3da68cfe21 Remove unused imports 2014-08-04 14:13:40 +02:00
Brian Clozel 95e9b380d3 Update ResourceHandlerReg. API for Resource handling
This change adds new methods in the ResourceHandlerRegistration API
for registering ResourceResolvers and ResourceTransformers, allowing
to better handle server-side resources in web applications.i

Here is an example of configuration for an HTML5 web application
that uses JavaScript and HTML5 appcache manifests:

    registry.addResourceHandler("/**")
      .addResourceLocations("classpath:static/")
      .addTransformer(new AppCacheManifestTransfomer())
      .addVersion("v1", "/**/*.js")
      .addVersionHash("/**");

Issue: SPR-11982
2014-08-01 19:04:07 +02:00
Rossen Stoyanchev 16273473cb Update Javadoc
Issue: SPR-12028
2014-07-29 18:06:05 -04:00
Rossen Stoyanchev 968492c28b Update constructor for AbstractJsonpResponseBodyAdvice 2014-07-29 11:42:18 -04:00
Juergen Hoeller 3bcfc591e9 Polishing 2014-07-29 14:11:19 +02:00
Juergen Hoeller 8f484d382e Polishing 2014-07-29 11:42:37 +02:00
Juergen Hoeller 7bc966032b Rearranged statement whitespace in Velocity macros 2014-07-29 11:42:29 +02:00
Rossen Stoyanchev d917b8a923 Extract base interface for VersionStrategy
This change splits out a base VersionPathStrategy interface that
focuses on where in the URL path the version is embedded.
2014-07-29 10:41:02 +02:00
Rossen Stoyanchev 105ea196e4 Polish 2014-07-22 15:40:49 -04:00
Rob Winch 1b53882f55 Generate bracketless tag id in Velocity forms
Before this change if Velocity Spring form macro was bound to a path
which contains square brackets, those brackets would also appear in id
of generated tag, making the id invalid.

As of this fix all Velocity Spring form macros generate tag with id
that does not contain square brackets.

Issue: SPR-5172
2014-07-22 15:33:23 -04:00
Rossen Stoyanchev 6c4aff4c9d Polish 2014-07-22 11:21:39 -04:00
Sebastien Deleuze 9092102a83 Fix issue with @EnableWebMvc + existing ViewResolver
Issue: SPR-12013
2014-07-22 11:21:39 -04:00
Rossen Stoyanchev e41b14449e Restore method signature in ViewControllerRegistration
Issue: SPR-12016
2014-07-22 11:21:39 -04:00
Juergen Hoeller 9d6c38bd54 Consistent bracket alignment 2014-07-18 17:21:58 +02:00
Rossen Stoyanchev 27153b2982 Polish interceptor registration MVC config 2014-07-17 23:47:56 -04:00
Marten Deinum 84c11a5cc7 Allow interceptors with excludePathPattern only
Issue: SPR-11130
2014-07-17 23:36:41 -04:00
Sebastien Deleuze 52f1be7ade Add "-configurer" suffix to view configurer element names
Issue: SPR-7093
2014-07-17 23:18:41 -04:00
Rossen Stoyanchev 1ad22b922f Enhance view controller MVC config
This change adds support for configuring redirect view controllers and
also status controllers to the MVC Java config and the MVC namespace.

Issue: SPR-11543
2014-07-17 23:04:08 -04:00
Rossen Stoyanchev 0bbb7704b5 Add propagateQueryParams property to RedirectView
This change makes it possible to configure RedirectView such that the
query string of the current request is added to the target URL.

This change is preparation for SPR-11543.
2014-07-17 23:04:08 -04:00
Rossen Stoyanchev 0e2c5ee96c Enhance ParameterizableViewController
This change two new capabilities to ParameterizableViewController:

 - configure a View instance (in addition to view name)
 - configure response status code

The status code may be useful to send a 404 while also writing to the
body using a view.

The status code may also be used to override the redirect status code
of RedirectView. Even today it's possible to configure a "redirect:"
prefixed view name but the status code could not be selected. When a
3xx status is set, the code is passed on to the RedirectView while the
view name is automatically prefixed with "redirect:" (if not already).

For full control over RedirectView it is now also possible to
parameterize the controller with a View instance.

As one more possible resulting variation, given status 204 and no view
the request is considered handled (controller returns null).

This change is preparation for SPR-11543.
2014-07-17 23:04:08 -04:00
Rossen Stoyanchev dfcc1d7e8c Add default ViewResolver to MVC Java config
Since the MVC Java config always registers a ViewResolver (composite)
bean, at a very minimum we must add an InternalResourceViewResolver
consistent with default DispatcherServlet configuration and by
extension with the MVC namespace which falls back on DispatcherServlet
implicity if no <view-resolvers> element is present.

Issue: SPR-7093
2014-07-17 23:04:08 -04:00
Rossen Stoyanchev 7f7fd7d311 Polish view controller MVC config 2014-07-17 23:04:08 -04:00
Rossen Stoyanchev 61ec8fd236 Polish 2014-07-17 23:04:08 -04:00
Rossen Stoyanchev d23b0fec0c Polish 2014-07-16 21:43:30 -04:00
Sebastien Deleuze 80f4ea13c7 Add Groovy markup templating support to the MVC config
Issue: SPR-11998
2014-07-16 21:43:30 -04:00
Juergen Hoeller 980f971236 SelectedValueComparator defensively handles null values in exhaustiveCompare
Issue: SPR-12001
2014-07-16 15:11:19 +02:00
Rossen Stoyanchev 10a4c2cd81 Remove FreeMarker/Velocity/TilesConfigurer MVC config
After some further discussion:

The MVC config simplifies ViewResolver configuration especially where
content negotiation view resolution is involved.

The configuration of the underlying view technology however is kept
completely separate. In the case of the MVC namespace, dedicated
top-level freemarker, velocity, and tiles namespace elements are
provided. In the case of the MVC Java config, applications simply
declare FreeMarkerConfigurer, VelocityConfigurer, or TilesConfigurer
beans respectively.

Issue: SPR-7093
2014-07-15 14:27:01 -04:00
Rossen Stoyanchev 5e1a5c8d51 Update view-resolver namespace
Issue: SPR-7093
2014-07-13 22:53:29 -04:00
Rossen Stoyanchev f54cee47b0 Update ViewResolver registration classes
Following the separation of FreeMarker/Velocity/TilesConfigurer-related
configuration via separate interface, simplify and streamline the
view registration helper classes which no longer have much difference
(most are UrlBasedViewResolver's).

Updates to Javadoc and tests.

Issue: SPR-7093
2014-07-13 22:53:23 -04:00
Rossen Stoyanchev 5bc793768c Introduce Freemarker/Velocity/TilesWebMvcConfigurer
This change improves the support for auto-registration of FreeMarker,
Velocity, and Tiles configuration.

The configuration is now conditional not only based on the classpath
but also based on whether a FreeMarkerConfigurer for example is already
present in the configuration.

This change also introduces FreeMarker~, Velocity~, and
TilesWebMvcConfigurer interfaces for customizing each view technology.

The WebMvcConfigurer can still be used to configure all view resolvers
centrally (including FreeMarker, Velocity, and Tiles) without some
default conifguration, i.e. without the need to use the new
~WebMvcConfigurer interfaces until customizations are required.

Issue: SPR-7093
2014-07-12 17:23:47 -04:00
Sebastien Deleuze cc7e8f5558 Support Java and MVC namespace view resolution config
This commit improves and completes the initial MVC namespace
view resolution implementation. ContentNegotiatingViewResolver
registration is now also supported.

Java Config view resolution support has been added.
FreeMarker, Velocity and Tiles view configurers are registered
depending on the classpath thanks to an ImportSelector.

For both, a default configuration is provided and documented.

Issue: SPR-7093
2014-07-12 17:23:47 -04:00
Sebastien Deleuze a26b1ef8d9 Make Tiles 3 the default implementation in spring-webmvc
Move spring-webmvc-tiles3 content to spring-webmvc, and
create a spring-webmvc-tiles2 module with Tiles 2 support.

Its allows View Resolution to configure Tiles 3 instead of Tiles 2.

Issue: SPR-7093
2014-07-12 17:23:47 -04:00
Siva Prasad Valluru 92402e7715 Add initial support for MVC namespace view resolution config
<mvc:view-resolution /> now allows to configure easily
view resolvers.

Issue: SPR-7093
2014-07-12 17:23:47 -04:00
Rossen Stoyanchev 2ba8fd7e59 Polish 2014-07-11 09:17:02 -04:00
Brian Clozel 2c77de10dd Fix X-Forwarded-* behavior in ServletUriComponentsBuilder
When using ServletUriComponentsBuilder.fromRequest, this change
makes sure that:
* the default port is used when the "X-Forwarded-Host" header is set
and no port is defined in that header value
* to use the scheme defined in the "X-Forwarded-Proto" header if set

Issue: SPR-11872
2014-07-11 00:55:17 +02:00
Brian Clozel bf7dac5fc8 Rename AppCacheResourceTransformer
This change renames AppCacheResourceTransformer to
AppCacheManifestTransfomer, in order to avoid confusion between this
transformer and the CacheResourceTransformer (which caches
transformations done by the chain to save CPU/memory at runtime).

Issue: SPR-11964
2014-07-10 18:17:48 +02:00
Brian Clozel f11815c960 Add AppCacheResourceTransformer
This change adds a new ResourceTransformer that helps handling resources
within HTML5 AppCache manifests for HTML5 offline application.

This transformer:
* modifies links to match the public URL paths
* appends a comment in the manifest, containing a Hash (e.g. "# Hash:
9de0f09ed7caf84e885f1f0f11c7e326")

See http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html#offline
for more details on HTML5 offline apps and appcache manifests.

Here is a WebConfig example:

  @Override
  public void addResourceHandlers(ResourceHandlerRegistry registry) {

    AppCacheResourceTransformer appCacheTransformer =
          new AppCacheResourceTransformer();

      registry.addResourceHandler("/**")
          .addResourceLocations("classpath:static/")
          .setResourceResolvers(...)
          .setResourceTransformers(..., appCacheTransformer);
  }

Issue: SPR-11964
2014-07-10 16:55:25 +02:00
Juergen Hoeller 3c726aa6c1 Polishing 2014-07-09 21:24:59 +02:00
Juergen Hoeller 777085bbfc MappingJackson2JsonView/MessageConverter calls non-deprecated Jackson 2.1+ createGenerator API
Also removing workaround for https://github.com/FasterXML/jackson-databind/issues/12 (fixed in 2.1+)

Issue: SPR-11262
2014-07-09 21:23:09 +02:00
Rossen Stoyanchev fa33ed4b4b Support <ref> for arg resolvers return value handlers
Issue: SPR-11927
2014-07-09 15:11:20 -04:00
Rossen Stoyanchev 0d5c5a3d33 Fix white space issue 2014-07-09 15:11:19 -04:00
Agim Emruli 19760f9eb9 Add support to reference external HandlerMethodArgumentResolver beans which might contain already configured instances (e.g. through a 3rd-party namespace handler).
Users can not mix and match between "inner bean" argument resolver and "external bean" argument resolver. This commit only focuses only on argument-resolver, while the support could be extended to return value handlers as well.

 Issue: SPR-11927
2014-07-09 15:11:19 -04:00
Juergen Hoeller b559f15a00 Polishing 2014-07-07 21:45:40 +02:00
Brian Clozel ea4a5d4722 Add XML config support ResourceResolver & ResourceTransformer
This change adds support for configuring ResourceResolvers and
ResourceTransformers with ResourceHttpRequestHandlers.

This is an example configuration:

    <mvc:resources mapping="/resources/**" location="/">
      <mvc:resolvers>
        <bean class="org.springframework.web.servlet.resource.PathResourceResolver"/>
        <ref bean="myResourceResolver"/>
      </mvc:resolvers>
      <mvc:transformers>
        <bean class="org.springframework.web.servlet.resource.CssLinkResourceTransformer" />
      </mvc:transformers>
    </mvc:resources>

    <bean id="myResourceResolver" class="org.example.resource.MyResourceResolver"/>

Issue: SPR-10951
2014-07-02 16:47:08 +02:00
Juergen Hoeller 367b0394a2 Spring's ROME support requires ROME 1.5 (com.rometools.rome) now
Issue: SPR-11893
2014-07-02 15:04:41 +02:00
Rossen Stoyanchev 476864f3e9 Expose handled exception as request attribute
This change exposes exceptions handled in the DispatcherServlet with a
HandlerExceptionResolver as a request attribute. This is done only when
the resolver returns an empty ModelAndView indicating the exception was
resolved but not view is required (e.g. status code was set). In such
cases the exception may be useful to any handlers in an ERRPR dispatch
by the servlet container.

Issue: SPR-11686
2014-07-01 23:32:27 -04:00
Rossen Stoyanchev d3a87a13f7 Polish 2014-07-01 16:10:00 -04:00
Arjen Poutsma f6fbdafb6a Introduce RequestEntity and builder
This commit introduces the RequestEntity, a class similar to
ResponseEntity, but meant for HTTP requests rather than responses. The
RequestEntity can be used both in RestTemplate as well as @MVC
scenarios.

The class also comes with a builder, similar to the one found in
ResponseEntity, which allows for building of a RequestEntity through a
fluent API.

Issue: SPR-11752
2014-07-01 16:10:00 -04:00
Juergen Hoeller ba522e5e55 Package javadoc cleanup for web.servlet.mvc, removing outdated references
Issue: SPR-11935
2014-07-01 17:26:27 +02:00
Juergen Hoeller cc917de24d Polishing 2014-06-26 11:44:07 +02:00
Juergen Hoeller 779ca99f38 SelectTag consistently checks specified 'multiple' attribute now, never falling back to forceMultiple in case of user-provided value
Issue: SPR-11903
2014-06-25 12:36:51 +02:00
Brian Clozel 13c4a0396d Refactor VersionResourceResolver in strategies
Prior to this commit, one of the available strategies for resolving
resources was the PrefixResourceResolver. Reconsidering the core goal of
this resolver and the FingerprintResourceResolver, we found that the
true core feature is versioning static resources application-wide.

This commit refactors both Resolvers by:
* having only on VersionResourceResolver
* that resolver takes a mapping of paths -> VersionStrategy
* provided VersionStrategy implementations are ContentBasedVS
  (previously FingerprintRR), FixedVS (previously PrefixRR)

One can add a VersionResourceResolver like this:

  Map<String, VersionStrategy> versionStrategies = new HashMap<>();
  versionStrategies.put("/**/*.js", new PrefixVersionStrategy("prefix"));
  versionStrategies.put("/**", new ContentBasedVersionStrategy());

  VersionResourceResolver versionResolver = new VersionResourceResolver();
  versionResolver.setVersionStrategyMap(versionStrategies);

  List<ResourceResolver> resolvers = new ArrayList<ResourceResolver>();
  resolvers.add(versionResolver);
  resolvers.add(new PathResourceResolver());

Issue: SPR-11871
2014-06-24 18:18:05 +02:00
Juergen Hoeller 18131bf611 Consistent declaration of private static final logger variables
Issue: SPR-11905
2014-06-24 14:02:05 +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
Brian Clozel 72baa9bf27 Ignore external resources in CssLinkResourceTransormer
Prior to this commit, the CssLinkResourceTransformer would transform
"external resources", i.e. resources not served by the web application.

This commit only allows transformation for resources which path don't
contain scheme such as "file://" or "http://". Only relative and
absolute paths for resources served by the webapp are valid.

Issue: SPR-11860
2014-06-12 10:54:41 +02:00
Rossen Stoyanchev 9f4d4d1829 Check X-Forwarded-Host in ServletUriComponentsBuilder
Issue: SPR-11855
2014-06-11 22:40:48 -04:00
Brian Clozel 80a16c6d10 PathMatching options:configure all HandlerMappings
Since SPR-11486 and SPR-10163, Path Matching options can be configured
to customize path matching options for RequestMappingHandlerMapping.
Prior to this commit, the defined pathMatcher and pathHelper instances
were only used in RequestMappingHandlerMapping.

This commit now registers pathMatcher and pathHelper beans under
well-known names and share them with several HandlerMappings beans,
such as ViewControllerMappings and ResourcesMappings.

Issue: SPR-11753
2014-06-11 17:07:04 +02:00
Rossen Stoyanchev 6b129c52e3 Add "mvcUrl" function to Spring tag library
This commit adds a new function to the Spring tag library for preparing
links to @Controller methods. For more details see the Javadoc of
MvcUriComponentsBuilder.fromMappingName.

Issue: SPR-5779
2014-06-10 18:11:11 -04:00
Rossen Stoyanchev 2140648246 Fix failing test 2014-06-10 15:03:17 -04:00
Rossen Stoyanchev 5b02222a9f Add resolveTemplate method to Groovy markup configurer 2014-06-10 11:59:11 -04:00
Brian Clozel 0ecfa8e404 Add Spring View support for Groovy Markup Templates
This commit adds support for Groovy Markup templates.
Spring's support requires Groovy 2.3.1+.

To use it, simply create a GroovyMarkupConfigurer and a
GroovyMarkupViewResolver beans in the web application context.

Issue: SPR-11789
2014-06-10 11:37:53 -04:00
Rossen Stoyanchev 0cb6f8c88c Polish MappingJackson2JsonView 2014-06-09 09:39:17 -04:00
Sebastien Deleuze 5dc27ee134 Add JSONP support to MappingJackson2JsonView
Enable JSONP support by wrapping the JSON output into
a callback when a JSONP query parameter specifying the
function name to use as callback is detected.

Default query parameter names recognized as JSONP ones
are "jsonp" and "callback". This list can be customized if
needed.

This commit also fixes JSONView support by removing
the view name specified in the model from the output.

Issue: SPR-8346
2014-06-09 09:39:17 -04:00
Rossen Stoyanchev de1a41ac27 Fix issue with RequestBody(required=true)
Issue: SPR-11828
2014-06-06 12:07:14 -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
Rossen Stoyanchev c9d0ebd730 Rename ResponseBodyInterceptor to ResponseBodyAdvice
Issue: SPR-10859
2014-05-30 17:02:28 -04:00
Rossen Stoyanchev 2655c507e0 Parameterize ResponseBodyInterceptor on the type level
Issue: SPR-10859
2014-05-30 17:02:28 -04:00
Juergen Hoeller e4aabd5288 MarshallingView unwraps JAXBElement value for Marshaller.supports(Class) check
Issue: SPR-11827
2014-05-30 17:27:34 +02:00
Juergen Hoeller 4e17685008 Made transform test pass on Windows 2014-05-30 17:27:14 +02:00
Rossen Stoyanchev 3944f7ad97 Fix animalSniffer warning 2014-05-27 21:27:35 -04:00
Rossen Stoyanchev 6966e89578 Add ResourceTransformer and CSS link implementation
This change adds a ResourceTransformer that can be invoked in a chain
after resource resolution. The CssLinkResourceTransformer modifies a
CSS file being served in order to update its @import and url() links
(e.g. to images or other CSS files) to match the resource resolution
strategy (e.g. adding MD5 content-based hashes).

Issue: SPR-11800
2014-05-27 20:54:22 -04:00
Rossen Stoyanchev e3a6fce403 Add Gson converter to MVC config
Issue: SPR-9488
2014-05-22 22:23:00 -04:00
Rossen Stoyanchev 1338d46a6e Add JSONP support for MappingJackson2MessageConverter
Issue: SPR-9899
2014-05-20 12:13:44 -04:00
Juergen Hoeller 61b47ba7d9 Consistent MvcUriComponentsBuilder assertion handling 2014-05-20 01:43:01 +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
Rossen Stoyanchev 96b18c8dc2 Add ResponseBodyInterceptor
This change introduces a new ResponseBodyInterceptor interface that can
be used to modify the response after @ResponseBody or ResponseEntity
methods but before the body is actually written to the response with the
selected HttpMessageConverter.

The RequestMappingHandlerAdapter and ExceptionHandlerExceptionResolver
each have a property to configure such interceptors. In addition both
RequestMappingHandlerAdapter and ExceptionHandlerExceptionResolver
detect if any @ControllerAdvice bean implements ResponseBodyInterceptor
and use it accordingly.

Issue: SPR-10859
2014-05-19 15:47:16 -04: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
Juergen Hoeller e04fb15a5e Compilation compatibility with JasperReports 5.5.2 2014-05-12 20:34:38 +02:00
Juergen Hoeller 782d10c66f JasperReports-related polishing 2014-05-12 20:27:53 +02:00
Rossen Stoyanchev 426b77b834 Support path segment URI var expansion in UrlTag
Before this change UrlTag expanded URI vars and encoded them using
UriUtils.encodePath.

This change makes it possible to expand using
UriUtils.encodePathSegment, which means a "/" is encoded as "%2F".

To expand with path segment semantics, prefix the URI var name "/":

<spring:url value="/url/path/{/var}">
    <spring:param name="var" value="my/Id" />
</spring:url>

Issue: SPR-11401
2014-05-06 19:41:17 -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
Rossen Stoyanchev cb2834c10a Fix compile error 2014-05-01 13:40:23 -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
Sebastien Deleuze 59a050f3b9 Include more guidance about DispatcherServlet context
Also update <mvc:annotation-driven /> comment in XSD.

Issue: SPR-11703
2014-04-28 22:07:55 -04:00
Rossen Stoyanchev 1f630a5fb9 Add CachingResourceResolver 2014-04-25 16:49:49 -04:00
Rossen Stoyanchev e24b876164 Remove "Public" from the ResourceUrlProvider name
Also respect HandlerMapping order in ResourceUrlProvider
2014-04-25 16:49:32 -04:00
Brian Clozel 564a555619 Fix NPE in PrefixResourceResolver
The ResourceResolverChain can return null, so PrefixResourceResolver
should be skipped in that case.
2014-04-25 15:15:53 +02:00
Rossen Stoyanchev f5cbd9aa4a Switch to vararg for configuring ResourceResolver's 2014-04-25 00:01:24 -04:00
Brian Clozel c4843577ba Fix PrefixResourceResolver implementation
The configured prefix should not begin with a "/", since
PublicResourceUrlProvider is already taking path mapping into account
when resolving resources and URLs.
2014-04-24 14:43:26 +02:00
Juergen Hoeller ec7d80b851 Polishing 2014-04-23 23:03:47 +02:00
Rossen Stoyanchev b1158aa913 Polish logging in resource handling 2014-04-23 15:43:39 -04:00
Juergen Hoeller 5b47816183 DispatcherServlet skips multipart resolution if error page exception attribute indicates MultipartException as root cause
Issue: SPR-11716
2014-04-23 14:36:14 +02:00