Package de.xima.fc.mdl.response
Class ServletResponse
- java.lang.Object
 - 
- de.xima.fc.mdl.response.ServletResponse
 
 
- 
- All Implemented Interfaces:
 IServletResponse,Serializable
- Direct Known Subclasses:
 WorkflowResponse
public class ServletResponse extends Object implements IServletResponse
Modelklasse für Daten welche innerhalb eines Servlet-Response behandelt werden können- Author:
 - XIMA MEDIA GmbH
 - See Also:
 - Serialized Form
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected booleanappendFormSessionIdprotected byte[]binValueprotected StringcontentTypeprotected Stringencodingprotected booleanforceDownloadprotected Map<String,String>httpHeaderprotected inthttpStatusCodeprotected longlongValueprotected Map<String,Serializable>sessionAttributesprotected EResponseTypetypeprotected Stringvalue 
- 
Constructor Summary
Constructors Constructor Description ServletResponse(IServletResponse response)ServletResponse(EResponseType type)ServletResponse(EResponseType type, long longValue)ServletResponse(EResponseType type, String value)ServletResponse(EResponseType type, String value, byte[] binValue)ServletResponse(EResponseType type, String value, byte[] binValue, boolean forceDownload) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHttpHeader(String name, String value)Adds an HTTP header with the given name.byte[]getBinValue()The binary data for the response.StringgetContentType()Applies only whenIServletResponse.getType()is set toEResponseType.SHOW_FILE:StringgetEncoding()Applies only whenIServletResponse.getType()is set toEResponseType.TEMPLATE,EResponseType.TEMPLATE_SYSTEM, orEResponseType.HTML.Map<String,String>getHttpHeader()intgetHttpStatusCode()longgetLongValue()Returns an long value.Map<String,Serializable>getSessionAttributes()EResponseTypegetType()StringgetValue()The plain-text data of the response, used only whenIServletResponse.getType()is not set to a binary response type or redirect.booleanisAppendFormSessionID()booleanisForceDownload()Applies only whenIServletResponse.getType()is set toEResponseType.SHOW_FILE.voidsetAppendFormSessionID(boolean appendFormSessionID)voidsetBinValue(byte[] binValue)Setter des byteValuevoidsetContentType(String contentType)voidsetEncoding(String encoding)voidsetForceDownload(boolean forceDownload)voidsetHttpHeader(Map<String,String> httpHeader)voidsetHttpStatusCode(int httpStatusCode)voidsetLongValue(long longValue)voidsetSessionAttributes(Map<String,Serializable> sessionAttributes)voidsetType(EResponseType type)voidsetValue(String value) 
 - 
 
- 
- 
Field Detail
- 
value
protected String value
 
- 
longValue
protected long longValue
 
- 
contentType
protected String contentType
 
- 
sessionAttributes
protected Map<String,Serializable> sessionAttributes
 
- 
encoding
protected String encoding
 
- 
binValue
protected byte[] binValue
 
- 
type
protected EResponseType type
 
- 
forceDownload
protected boolean forceDownload
 
- 
appendFormSessionId
protected boolean appendFormSessionId
 
- 
httpStatusCode
protected int httpStatusCode
 
 - 
 
- 
Constructor Detail
- 
ServletResponse
public ServletResponse(IServletResponse response)
 
- 
ServletResponse
public ServletResponse(EResponseType type, String value, byte[] binValue, boolean forceDownload)
 
- 
ServletResponse
public ServletResponse(EResponseType type, String value, byte[] binValue)
 
- 
ServletResponse
public ServletResponse(EResponseType type, String value)
 
- 
ServletResponse
public ServletResponse(EResponseType type, long longValue)
 
- 
ServletResponse
public ServletResponse(EResponseType type)
 
 - 
 
- 
Method Detail
- 
getValue
public String getValue()
Description copied from interface:IServletResponseThe plain-text data of the response, used only whenIServletResponse.getType()is not set to a binary response type or redirect.- Specified by:
 getValuein interfaceIServletResponse- Returns:
 - The plain-text content of the HTTP response.
 
 
- 
setValue
public void setValue(String value)
 
- 
getType
public EResponseType getType()
- Specified by:
 getTypein interfaceIServletResponse- Returns:
 - The type of response, such as whether a plain text or binary file should be returned, or a redirect should be performed.
 
 
- 
setType
public void setType(EResponseType type)
 
- 
getBinValue
public byte[] getBinValue()
Description copied from interface:IServletResponseThe binary data for the response. Applies only whenIServletResponse.getType()is set toEResponseType.SHOW_FILE.- Specified by:
 getBinValuein interfaceIServletResponse- Returns:
 - The binary content of the HTTP response.
 
 
- 
setBinValue
public void setBinValue(byte[] binValue)
Setter des byteValue- Parameters:
 binValue-Byte-Array der zu setzende binValue
 
- 
isForceDownload
public boolean isForceDownload()
Description copied from interface:IServletResponseApplies only whenIServletResponse.getType()is set toEResponseType.SHOW_FILE.- Specified by:
 isForceDownloadin interfaceIServletResponse- Returns:
 - If 
true, attempts to prevent browsers from showing the binary content inline. Iffalse, the browser may show the content inline, which is useful for PDF, image or plain text files. Please note that support for this differs between browsers. 
 
- 
setForceDownload
public void setForceDownload(boolean forceDownload)
 
- 
getEncoding
public String getEncoding()
Description copied from interface:IServletResponseApplies only whenIServletResponse.getType()is set toEResponseType.TEMPLATE,EResponseType.TEMPLATE_SYSTEM, orEResponseType.HTML.- Specified by:
 getEncodingin interfaceIServletResponse- Returns:
 - The encoding that is to be used for encoding the response.
 
 
- 
setEncoding
public void setEncoding(String encoding)
 
- 
setAppendFormSessionID
public void setAppendFormSessionID(boolean appendFormSessionID)
 
- 
isAppendFormSessionID
public boolean isAppendFormSessionID()
 
- 
getLongValue
public long getLongValue()
Description copied from interface:IServletResponseReturns an long value. IfEResponseType.FORM_RECORDis set, this is the id of the record.- Specified by:
 getLongValuein interfaceIServletResponse- Returns:
 - an long value
 
 
- 
setLongValue
public void setLongValue(long longValue)
 
- 
getHttpStatusCode
public int getHttpStatusCode()
- Specified by:
 getHttpStatusCodein interfaceIServletResponse- Returns:
 - The HTTP status code of the HTTP response.
 
 
- 
setHttpStatusCode
public void setHttpStatusCode(int httpStatusCode)
 
- 
getContentType
public String getContentType()
Description copied from interface:IServletResponseApplies only whenIServletResponse.getType()is set toEResponseType.SHOW_FILE:Must return the content type (=mime type) that is to be sent along with the binary data. When this is either
nullor blank, an attempt is made to guess the content type from the binary data. Please note that this may fail to determine the actual content type, you should always provide a content type.- Specified by:
 getContentTypein interfaceIServletResponse- Returns:
 - The content type of the binary data.
 
 
- 
setContentType
public void setContentType(String contentType)
 
- 
getSessionAttributes
public Map<String,Serializable> getSessionAttributes()
- Specified by:
 getSessionAttributesin interfaceIServletResponse- Returns:
 - A 
Mapwith attributes that should be written to theHttpSession. Existing values in theHttpSessionare overwritten. 
 
- 
setSessionAttributes
public void setSessionAttributes(Map<String,Serializable> sessionAttributes)
 
- 
getHttpHeader
public Map<String,String> getHttpHeader()
- Specified by:
 getHttpHeaderin interfaceIServletResponse- Returns:
 - A 
Mapof HTTP headers that should be sent along with the HTTP response. 
 
- 
setHttpHeader
public void setHttpHeader(Map<String,String> httpHeader)
- Parameters:
 httpHeader- the httpHeader to set
 
 - 
 
 -