public class TinyContentNegotiatingViewResolver
extends org.springframework.web.context.support.WebApplicationObjectSupport
implements org.springframework.web.servlet.ViewResolver, org.springframework.core.Ordered, org.springframework.beans.factory.InitializingBean
Modifier and Type | Field and Description |
---|---|
static String |
PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE |
static String |
SELECTED_CONTENT_TYPE
The
MediaType selected during content negotiation, which may be
more specific than the one the View is configured with. |
Constructor and Description |
---|
TinyContentNegotiatingViewResolver() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
ContentNegotiationManager |
getContentNegotiationManager() |
List<org.springframework.web.servlet.View> |
getDefaultViews() |
protected List<org.springframework.http.MediaType> |
getMediaTypes(javax.servlet.http.HttpServletRequest request)
Determines the list of
MediaType for the given
HttpServletRequest . |
int |
getOrder() |
List<org.springframework.web.servlet.ViewResolver> |
getViewResolvers() |
protected void |
initServletContext(javax.servlet.ServletContext servletContext) |
boolean |
isUseNotAcceptableStatusCode() |
org.springframework.web.servlet.View |
resolveViewName(String viewName,
Locale locale) |
void |
setAssemblyService(AssemblyService<org.springframework.web.servlet.ViewResolver> assemblyService) |
void |
setContentNegotiationManager(ContentNegotiationManager contentNegotiationManager) |
void |
setDefaultViews(List<org.springframework.web.servlet.View> defaultViews)
Set the default views to use when a more specific view can not be
obtained from the
ViewResolver chain. |
void |
setMediaTypes(Map<String,String> mediaTypes) |
void |
setOrder(int order) |
void |
setUseNotAcceptableStatusCode(boolean useNotAcceptableStatusCode) |
void |
setViewResolvers(List<org.springframework.web.servlet.ViewResolver> viewResolvers)
Sets the view resolvers to be wrapped by this view resolver.
|
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, isContextRequired, setServletContext
public static final String PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE
public static final String SELECTED_CONTENT_TYPE
MediaType
selected during content negotiation, which may be
more specific than the one the View is configured with. For example:
"application/vnd.example-v1+xml" vs "application/*+xml".public int getOrder()
getOrder
in interface org.springframework.core.Ordered
public void setOrder(int order)
public ContentNegotiationManager getContentNegotiationManager()
public void setContentNegotiationManager(ContentNegotiationManager contentNegotiationManager)
public boolean isUseNotAcceptableStatusCode()
public void setUseNotAcceptableStatusCode(boolean useNotAcceptableStatusCode)
public List<org.springframework.web.servlet.View> getDefaultViews()
public void setDefaultViews(List<org.springframework.web.servlet.View> defaultViews)
ViewResolver
chain.public void setAssemblyService(AssemblyService<org.springframework.web.servlet.ViewResolver> assemblyService)
public List<org.springframework.web.servlet.ViewResolver> getViewResolvers()
public void setViewResolvers(List<org.springframework.web.servlet.ViewResolver> viewResolvers)
If this property is not set, view resolvers will be detected automatically.
protected void initServletContext(javax.servlet.ServletContext servletContext)
initServletContext
in class org.springframework.web.context.support.WebApplicationObjectSupport
public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
public org.springframework.web.servlet.View resolveViewName(String viewName, Locale locale) throws Exception
resolveViewName
in interface org.springframework.web.servlet.ViewResolver
Exception
protected List<org.springframework.http.MediaType> getMediaTypes(javax.servlet.http.HttpServletRequest request)
MediaType
for the given
HttpServletRequest
.request
- the current servlet requestCopyright © 2006–2018 TinyGroup. All rights reserved.