diff --git a/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/view/ContentNegotiatingViewResolver.java b/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/view/ContentNegotiatingViewResolver.java
index 5bc8f383fdf..412689a0e24 100644
--- a/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/view/ContentNegotiatingViewResolver.java
+++ b/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/view/ContentNegotiatingViewResolver.java
@@ -73,14 +73,14 @@ import org.springframework.web.util.WebUtils;
* media type. The default name of the parameter is format and it can be configured using the
* {@link #setParameterName(String) parameterName} property.
*
Once the requested media type has been determined, this resolver queries each delegate view resolver for a * {@link View} and determines if the requested media type is {@linkplain MediaType#includes(MediaType) compatible} * with the view's {@linkplain View#getContentType() content type}). The most compatible view is returned. * @@ -358,7 +358,7 @@ public class ContentNegotiatingViewResolver extends WebApplicationObjectSupport *
The default implementation will check the {@linkplain #setMediaTypes(Map) media types} * property first for a defined mapping. If not present, and if the Java Activation Framework * can be found on the classpath, it will call {@link FileTypeMap#getContentType(String)} - *
This method can be overriden to provide a different algorithm. + *
This method can be overridden to provide a different algorithm.
* @param filename the current request file name (i.e. {@code hotels.html})
* @return the media type, if any
*/
@@ -454,6 +454,18 @@ public class ContentNegotiatingViewResolver extends WebApplicationObjectSupport
}
+ private static final View NOT_ACCEPTABLE_VIEW = new View() {
+
+ public String getContentType() {
+ return null;
+ }
+
+ public void render(Map By default, this converter can read all media types. The Java Activation Framework (JAF) - if available - is used
- * to determine the {@code Content-Type} of written resources. If JAF is not available, {@code application/octet-stream}
- * is used.
+ * By default, this converter can read all media types. The Java Activation Framework (JAF) -
+ * if available - is used to determine the {@code Content-Type} of written resources.
+ * If JAF is not available, {@code application/octet-stream} is used.
*
* @author Arjen Poutsma
* @since 3.0.2
@@ -49,6 +49,7 @@ public class ResourceHttpMessageConverter implements HttpMessageConverter