public class ServletResponse extends Object implements IServletResponse
| Modifier and Type | Field and 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 and Description |
|---|
ServletResponse(EResponseType type) |
ServletResponse(EResponseType type,
String value) |
ServletResponse(EResponseType type,
String value,
byte[] binValue) |
ServletResponse(EResponseType type,
String value,
byte[] binValue,
boolean forceDownload) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBinValue()
The binary data for the response.
|
String |
getContentType()
Applies only when
IServletResponse.getType() is set to EResponseType.SHOW_FILE:
Must return the content type (=mime type) that is to be sent along with the binary data. |
String |
getEncoding()
Applies only when
IServletResponse.getType() is set to EResponseType.TEMPLATE,
EResponseType.TEMPLATE_SYSTEM, or EResponseType.HTML. |
Map<String,String> |
getHttpHeader() |
int |
getHttpStatusCode() |
Map<String,Serializable> |
getSessionAttributes() |
EResponseType |
getType() |
String |
getValue()
The plain-text data of the response, used only when
IServletResponse.getType() is not set to a binary response type or
redirect. |
boolean |
isForceDownload()
Applies only when
IServletResponse.getType() is set to EResponseType.SHOW_FILE. |
void |
setBinValue(byte[] binValue)
Setter des byteValue
|
void |
setContentType(String contentType) |
void |
setEncoding(String encoding) |
void |
setForceDownload(boolean forceDownload) |
void |
setHttpHeader(Map<String,String> httpHeader) |
void |
setHttpStatusCode(int httpStatusCode) |
void |
setSessionAttributes(Map<String,Serializable> sessionAttributes) |
void |
setType(EResponseType type) |
void |
setValue(String value) |
protected String value
protected String contentType
protected Map<String,Serializable> sessionAttributes
protected String encoding
protected byte[] binValue
protected EResponseType type
protected boolean forceDownload
protected int httpStatusCode
public ServletResponse(EResponseType type, String value, byte[] binValue, boolean forceDownload)
public ServletResponse(EResponseType type, String value, byte[] binValue)
public ServletResponse(EResponseType type, String value)
public ServletResponse(EResponseType type)
public String getValue()
IServletResponseIServletResponse.getType() is not set to a binary response type or
redirect.getValue in interface IServletResponsepublic void setValue(String value)
public EResponseType getType()
getType in interface IServletResponsepublic void setType(EResponseType type)
public byte[] getBinValue()
IServletResponseIServletResponse.getType() is set to EResponseType.SHOW_FILE.getBinValue in interface IServletResponsepublic void setBinValue(byte[] binValue)
binValue - Byte-Array der zu setzende binValuepublic boolean isForceDownload()
IServletResponseIServletResponse.getType() is set to EResponseType.SHOW_FILE.isForceDownload in interface IServletResponsetrue, attempts to prevent browsers from showing the binary content inline. If false, 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.public void setForceDownload(boolean forceDownload)
public String getEncoding()
IServletResponseIServletResponse.getType() is set to EResponseType.TEMPLATE,
EResponseType.TEMPLATE_SYSTEM, or EResponseType.HTML.getEncoding in interface IServletResponsepublic void setEncoding(String encoding)
public int getHttpStatusCode()
getHttpStatusCode in interface IServletResponsepublic void setHttpStatusCode(int httpStatusCode)
public String getContentType()
IServletResponseIServletResponse.getType() is set to EResponseType.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.
getContentType in interface IServletResponsepublic void setContentType(String contentType)
public Map<String,Serializable> getSessionAttributes()
getSessionAttributes in interface IServletResponseMap with attributes that should be written to the HttpSession. Existing values in the
HttpSession are overwritten.public void setSessionAttributes(Map<String,Serializable> sessionAttributes)
public Map<String,String> getHttpHeader()
getHttpHeader in interface IServletResponseMap of HTTP headers that should be sent along with the HTTP response.Copyright © 2021 XIMA MEDIA GmbH. All rights reserved.