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 byte[]
binValue
protected String
contentType
protected String
encoding
protected boolean
forceDownload
protected Map<String,String>
httpHeader
protected int
httpStatusCode
protected Map<String,Serializable>
sessionAttributes
protected EResponseType
type
protected String
value
-
Constructor Summary
Constructors Constructor Description ServletResponse(IServletResponse response)
ServletResponse(EResponseType type)
ServletResponse(EResponseType type, String value)
ServletResponse(EResponseType type, String value, byte[] binValue)
ServletResponse(EResponseType type, String value, byte[] binValue, boolean forceDownload)
-
Method Summary
-
-
-
Field Detail
-
value
protected String value
-
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
-
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)
-
-
Method Detail
-
getValue
public String getValue()
Description copied from interface:IServletResponse
The plain-text data of the response, used only whenIServletResponse.getType()
is not set to a binary response type or redirect.- Specified by:
getValue
in interfaceIServletResponse
- Returns:
- The plain-text content of the HTTP response.
-
setValue
public void setValue(String value)
-
getType
public EResponseType getType()
- Specified by:
getType
in 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:IServletResponse
The binary data for the response. Applies only whenIServletResponse.getType()
is set toEResponseType.SHOW_FILE
.- Specified by:
getBinValue
in 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:IServletResponse
Applies only whenIServletResponse.getType()
is set toEResponseType.SHOW_FILE
.- Specified by:
isForceDownload
in 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:IServletResponse
Applies only whenIServletResponse.getType()
is set toEResponseType.TEMPLATE
,EResponseType.TEMPLATE_SYSTEM
, orEResponseType.HTML
.- Specified by:
getEncoding
in interfaceIServletResponse
- Returns:
- The encoding that is to be used for encoding the response.
-
setEncoding
public void setEncoding(String encoding)
-
getHttpStatusCode
public int getHttpStatusCode()
- Specified by:
getHttpStatusCode
in interfaceIServletResponse
- Returns:
- The HTTP status code of the HTTP response.
-
setHttpStatusCode
public void setHttpStatusCode(int httpStatusCode)
-
getContentType
public String getContentType()
Description copied from interface:IServletResponse
Applies 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
null
or 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:
getContentType
in interfaceIServletResponse
- Returns:
- The content type of the binary data.
-
setContentType
public void setContentType(String contentType)
-
getSessionAttributes
public Map<String,Serializable> getSessionAttributes()
- Specified by:
getSessionAttributes
in interfaceIServletResponse
- Returns:
- A
Map
with attributes that should be written to theHttpSession
. Existing values in theHttpSession
are overwritten.
-
setSessionAttributes
public void setSessionAttributes(Map<String,Serializable> sessionAttributes)
-
getHttpHeader
public Map<String,String> getHttpHeader()
- Specified by:
getHttpHeader
in interfaceIServletResponse
- Returns:
- A
Map
of HTTP headers that should be sent along with the HTTP response.
-
-