Package org.jasig.portlet.newsreader.mvc
Class EmptyView
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.view.AbstractView
org.jasig.portlet.newsreader.mvc.EmptyView
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.context.ApplicationContextAware,org.springframework.web.context.ServletContextAware,org.springframework.web.servlet.View
public class EmptyView
extends org.springframework.web.servlet.view.AbstractView
EmptyView class.
- Since:
- 5.1.1
- Author:
- bgonzalez
-
Field Summary
FieldsFields inherited from class org.springframework.context.support.ApplicationObjectSupport
loggerFields inherited from interface org.springframework.web.servlet.View
PATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectfilterModel(Map<String, Object> model) Filters out undesired attributes from the given model.protected voidprepareResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) protected voidrenderMergedOutputModel(Map<String, Object> model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) voidsetEncoding(com.fasterxml.jackson.core.JsonEncoding encoding) Sets theJsonEncodingfor this converter.voidsetObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Sets theObjectMapperfor this view.voidsetRenderedAttributes(Set<String> renderedAttributes) Sets the attributes in the model that should be rendered by this view.Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getRequestToExpose, getStaticAttributes, isExposePathVariables, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setRequestContextAttribute, setResponseContentType, toString, writeToResponseMethods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextMethods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
-
Field Details
-
DEFAULT_CONTENT_TYPE
Default content type. Overridable as bean property.- See Also:
-
-
Constructor Details
-
EmptyView
public EmptyView()Constructor for EmptyView.
-
-
Method Details
-
setObjectMapper
public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Sets theObjectMapperfor this view. If not set, a defaultObjectMapperis used.Setting a custom-configured
ObjectMapperis one way to take further control of the JSON serialization process. For example, an extendedSerializerFactorycan be configured that provides custom serializers for specific types. The other option for refining the serialization process is to use Jackson's provided annotations on the types to be serialized, in which case a custom-configured ObjectMapper is unnecessary.- Parameters:
objectMapper- aObjectMapperobject
-
setEncoding
public void setEncoding(com.fasterxml.jackson.core.JsonEncoding encoding) Sets theJsonEncodingfor this converter. By default, UTF-8 is used.- Parameters:
encoding- aJsonEncodingobject
-
setRenderedAttributes
Sets the attributes in the model that should be rendered by this view. When set, all other model attributes will be ignored.- Parameters:
renderedAttributes- aSetobject
-
prepareResponse
protected void prepareResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) - Overrides:
prepareResponsein classorg.springframework.web.servlet.view.AbstractView
-
renderMergedOutputModel
protected void renderMergedOutputModel(Map<String, Object> model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception- Specified by:
renderMergedOutputModelin classorg.springframework.web.servlet.view.AbstractView- Throws:
Exception
-
filterModel
Filters out undesired attributes from the given model. The return value can be either anotherMap, or a single value object.Default implementation removes
BindingResultinstances and entries not included in therenderedAttributesproperty.- Parameters:
model- the model, as passed on torenderMergedOutputModel(java.util.Map<java.lang.String, java.lang.Object>, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)- Returns:
- the object to be rendered
-