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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Default content type.

    Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

    logger

    Fields inherited from interface org.springframework.web.servlet.View

    PATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for EmptyView.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Object
    Filters out undesired attributes from the given model.
    protected void
    prepareResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    protected void
    renderMergedOutputModel(Map<String,Object> model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    void
    setEncoding(com.fasterxml.jackson.core.JsonEncoding encoding)
    Sets the JsonEncoding for this converter.
    void
    setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    Sets the ObjectMapper for this view.
    void
    setRenderedAttributes(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, writeToResponse

    Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport

    getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext

    Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

    getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • DEFAULT_CONTENT_TYPE

      public static final String 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 the ObjectMapper for this view. If not set, a default ObjectMapper is used.

      Setting a custom-configured ObjectMapper is one way to take further control of the JSON serialization process. For example, an extended SerializerFactory can 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 - a ObjectMapper object
    • setEncoding

      public void setEncoding(com.fasterxml.jackson.core.JsonEncoding encoding)
      Sets the JsonEncoding for this converter. By default, UTF-8 is used.
      Parameters:
      encoding - a JsonEncoding object
    • setRenderedAttributes

      public void setRenderedAttributes(Set<String> renderedAttributes)
      Sets the attributes in the model that should be rendered by this view. When set, all other model attributes will be ignored.
      Parameters:
      renderedAttributes - a Set object
    • prepareResponse

      protected void prepareResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Overrides:
      prepareResponse in class org.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:
      renderMergedOutputModel in class org.springframework.web.servlet.view.AbstractView
      Throws:
      Exception
    • filterModel

      protected Object filterModel(Map<String,Object> model)
      Filters out undesired attributes from the given model. The return value can be either another Map, or a single value object.

      Default implementation removes BindingResult instances and entries not included in the renderedAttributes property.

      Parameters:
      model - the model, as passed on to renderMergedOutputModel(java.util.Map<java.lang.String, java.lang.Object>, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
      Returns:
      the object to be rendered