public class FastJsonView
extends org.springframework.web.servlet.view.AbstractView
Compatible fastjson 1.2.x
AbstractView| Modifier and Type | Field and Description |
|---|---|
private boolean |
disableCaching
disableCaching
|
private boolean |
extractValueFromSingleKeyModel
extractValueFromSingleKeyModel
|
private FastJsonConfig |
fastJsonConfig
with fastJson config
|
private java.util.Set<java.lang.String> |
renderedAttributes
renderedAttributes
|
| Constructor and Description |
|---|
FastJsonView()
Set default param.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
filterModel(java.util.Map<java.lang.String,java.lang.Object> model)
Filters out undesired attributes from the given model.
|
FastJsonConfig |
getFastJsonConfig() |
boolean |
isExtractValueFromSingleKeyModel()
Check extractValueFromSingleKeyModel.
|
protected void |
prepareResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected void |
renderMergedOutputModel(java.util.Map<java.lang.String,java.lang.Object> model,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
setDisableCaching(boolean disableCaching)
Disables caching of the generated JSON.
|
void |
setExtractValueFromSingleKeyModel(boolean extractValueFromSingleKeyModel)
Set extractValueFromSingleKeyModel.
|
void |
setFastJsonConfig(FastJsonConfig fastJsonConfig) |
void |
setRenderedAttributes(java.util.Set<java.lang.String> renderedAttributes)
Set renderedAttributes.
|
protected void |
setResponseContentType(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
setUpdateContentLength(boolean updateContentLength)
Whether to update the 'Content-Length' header of the response.
|
addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, formatViewName, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getRequestToExpose, getStaticAttributes, isExposePathVariables, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setRequestContextAttribute, toString, writeToResponsegetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextprivate java.util.Set<java.lang.String> renderedAttributes
private boolean disableCaching
private boolean extractValueFromSingleKeyModel
private FastJsonConfig fastJsonConfig
public FastJsonConfig getFastJsonConfig()
public void setFastJsonConfig(FastJsonConfig fastJsonConfig)
fastJsonConfig - the fastJsonConfig to set.public void setRenderedAttributes(java.util.Set<java.lang.String> renderedAttributes)
renderedAttributes - renderedAttributespublic boolean isExtractValueFromSingleKeyModel()
public void setExtractValueFromSingleKeyModel(boolean extractValueFromSingleKeyModel)
protected void renderMergedOutputModel(java.util.Map<java.lang.String,java.lang.Object> model,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.lang.Exception
renderMergedOutputModel in class org.springframework.web.servlet.view.AbstractViewjava.lang.Exceptionprotected void prepareResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
prepareResponse in class org.springframework.web.servlet.view.AbstractViewpublic void setDisableCaching(boolean disableCaching)
Default is true, which will prevent the client from caching the
generated JSON.
public void setUpdateContentLength(boolean updateContentLength)
true, the response is buffered in order to determine the
content length and set the 'Content-Length' header of the response.
The default setting is false.
protected java.lang.Object filterModel(java.util.Map<java.lang.String,java.lang.Object> model)
Map, or a single value object.
Default implementation removes BindingResult instances and
entries not included in the renderedAttributes property.
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)protected void setResponseContentType(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
setResponseContentType in class org.springframework.web.servlet.view.AbstractView