|
Generated by JDiff |
||||||||
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |
This file contains all the changes in documentation in the packageorg.springframework.web.servlet.view
as colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
Implementation of ViewResolver that resolves a view based on the request file name or {@code Accept} header.Class ContentNegotiatingViewResolver, void setDefaultContentType(MediaType)The {@code ContentNegotiatingViewResolver} does not resolve views itself, but delegates to other ViewResolvers. By default, these other view resolvers are picked up automatically from the application context, though they can also be set explicitly by using the viewResolvers property. Note that in order for this view resolver to work properly, the order property needs to be set to a higher precedence than the others (the default is Ordered.HIGHEST_PRECEDENCE.)
This view resolver uses the requested MediaType media type to select a suitable View for a request.
This media type is determined by using the following criteria: If theThe requestedpath has a file extension and if the .setFavorPathExtension property is {@code true}, the mediaTypes property is inspected for a matchingmedia type. If the request contains a parameter defining the extension and if the .setFavorParameter propertyistrue, the mediaTypes property is inspected for a matching media type. The default namedeterminedofthrough theparameter is format and it can beconfiguredusing the parameterName property. If there is no match in the mediaTypes property and if the Java Activation Framework (JAF) is both #setUseJaf enabled and present on the classpath, FileTypeMap.getContentType(String) is used instead. If the previous steps did not result in a media type, andignoreAcceptHeaderContentNegotiationManageris {@code false}, the request {@code Accept} header is used.Once the requested media type has been determined, this resolver queries each delegate view resolver for a View and determines if the requested media type is MediaType#includes(MediaType) compatible with the view's View#getContentType() content type). The most compatible view is returned.Additionally, this view resolver exposes the defaultViews property, allowing you to override the views provided by the view resolvers. Note that these default views are offered as candicates, and still need have the content type requested (via file extension, parameter, or {@code Accept} header, described above). You can also set the #setDefaultContentType(MediaType) default content type directly, which will be returned when the other mechanisms ({@code Accept} header, file extension or parameter) do not result in a match.
For example, if the request path is {@code /view.html}, this view resolver will look for a view that has the {@code text/html} content type (based on the {@code html} file extension). A request for {@code /view} with a {@code text/html} request {@code Accept} header has the same result. @author Arjen Poutsma @author Juergen Hoeller @author Rossen Stoyanchev @since 3.0 @see ViewResolver @see InternalResourceViewResolver @see BeanNameViewResolver
Set the default content type.Class ContentNegotiatingViewResolver, void setFavorParameter(boolean)This content type will be used when file extension, parameter, nor {@code Accept} header define a content-type, either through being disabled or empty. @deprecated use .setContentNegotiationManager(ContentNegotiationManager)
Indicate whether a request parameter should be used to determine the requested media type, in favor of looking at the {@code Accept} header. The default value is {@code false}.Class ContentNegotiatingViewResolver, void setFavorPathExtension(boolean)For instance, when this flag is
true
, a request for {@code /hotels?format=pdf} will result in an {@code AbstractPdfView} being resolved, while the {@code Accept} header can be the browser-defined {@code text/html,application/xhtml+xml}. @deprecated use .setContentNegotiationManager(ContentNegotiationManager)
Indicate whether the extension of the request path should be used to determine the requested media type, in favor of looking at the {@code Accept} header. The default value is {@code true}.Class ContentNegotiatingViewResolver, void setIgnoreAcceptHeader(boolean)For instance, when this flag is
true
(the default), a request for {@code /hotels.pdf} will result in an {@code AbstractPdfView} being resolved, while the {@code Accept} header can be the browser-defined {@code text/html,application/xhtml+xml}. @deprecated use .setContentNegotiationManager(ContentNegotiationManager)
Indicate whether the HTTP {@code Accept} header should be ignored. Default is {@code false}.Class ContentNegotiatingViewResolver, void setMediaTypes(Map<String, String>)If set to {@code true}, this view resolver will only refer to the file extension and/or parameter, as indicated by the favorPathExtension and favorParameter properties. @deprecated use .setContentNegotiationManager(ContentNegotiationManager)
Set the mapping from file extensions to media types.Class ContentNegotiatingViewResolver, void setParameterName(String)When this mapping is not set or when an extension is not present, this view resolver will fall back to using a FileTypeMap when the Java Action Framework is available. @deprecated use .setContentNegotiationManager(ContentNegotiationManager)
Set the parameter name that can be used to determine the requested media type if the .setFavorParameter property is {@code true}. The default parameter name is {@code format}. @deprecated use .setContentNegotiationManager(ContentNegotiationManager)Class ContentNegotiatingViewResolver, void setUseJaf(boolean)
Indicate whether to use the Java Activation Framework to map from file extensions to media types.Default is {@code true}, i.e. the Java Activation Framework is used (if available). @deprecated use .setContentNegotiationManager(ContentNegotiationManager)