public class PhotonUnifiedResponse
extends com.helger.servlet.response.UnifiedResponse
UnifiedResponse with additional sanity methods for easier
pratical use.| Modifier and Type | Class and Description |
|---|---|
static class |
PhotonUnifiedResponse.HtmlHelper |
| Constructor and Description |
|---|
PhotonUnifiedResponse(com.helger.http.EHttpVersion eHttpVersion,
com.helger.commons.http.EHttpMethod eHttpMethod,
javax.servlet.http.HttpServletRequest aHttpRequest,
com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope) |
| Modifier and Type | Method and Description |
|---|---|
PhotonUnifiedResponse |
attachment(String sFilename) |
PhotonUnifiedResponse |
binary(com.helger.commons.io.stream.NonBlockingByteArrayOutputStream aBAOS,
com.helger.commons.mime.IMimeType aMimeType,
String sFilename) |
PhotonUnifiedResponse |
createAccepted()
HTTP 202 Accepted
|
PhotonUnifiedResponse |
createBadRequest()
HTTP 400 Bad Request
|
PhotonUnifiedResponse |
createConflict()
HTTP 409 Conflict
|
PhotonUnifiedResponse |
createInternalServerError()
HTTP 500 Internal Server Error
|
PhotonUnifiedResponse |
createNoContent()
HTTP 204 No Content
|
PhotonUnifiedResponse |
createNotFound()
HTTP 404 Not Found
|
PhotonUnifiedResponse |
createOk()
HTTP 200 OK
|
PhotonUnifiedResponse |
createPreconditionFailed()
HTTP 412 Precondition Failed
|
PhotonUnifiedResponse |
createSeeOther(com.helger.commons.url.ISimpleURL aRedirectTargetURL)
HTTP 303 See Other
|
static PhotonUnifiedResponse |
createSimple(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope)
Factory method
|
com.helger.json.serialize.IJsonWriterSettings |
getJsonWriterSettings() |
protected com.helger.web.scope.IRequestWebScopeWithoutResponse |
getRequestScope() |
com.helger.xml.serialize.write.IXMLWriterSettings |
getXMLWriterSettings() |
PhotonUnifiedResponse |
html(com.helger.html.hc.IHCHasChildrenMutable<?,? super com.helger.html.hc.IHCNode> aNode,
com.helger.html.hc.config.IHCOnDocumentReadyProvider aOnDocumentReadyProvider,
com.helger.json.IJsonObject aCustomJson) |
PhotonUnifiedResponse |
html(com.helger.html.hc.IHCNode aNode) |
PhotonUnifiedResponse |
htmlSimple(com.helger.html.hc.IHCNode aNode)
Create a simple HTML response without JSON structuring
|
PhotonUnifiedResponse |
json(com.helger.json.IJson aValue) |
PhotonUnifiedResponse |
jsonEmpty() |
PhotonUnifiedResponse |
pdf(byte[] aData,
String sFilename) |
PhotonUnifiedResponse |
pdf(com.helger.commons.io.stream.NonBlockingByteArrayOutputStream aBAOS) |
PhotonUnifiedResponse |
pdf(com.helger.commons.io.stream.NonBlockingByteArrayOutputStream aBAOS,
String sFilename) |
PhotonUnifiedResponse |
serialized(Serializable aObj) |
PhotonUnifiedResponse |
setContent(com.helger.commons.io.stream.NonBlockingByteArrayOutputStream aBAOS) |
void |
setJsonWriterSettings(com.helger.json.serialize.IJsonWriterSettings aJWS) |
void |
setXMLWriterSettings(com.helger.xml.serialize.write.IXMLWriterSettings aXWS) |
PhotonUnifiedResponse |
text(String sValue) |
PhotonUnifiedResponse |
xml(byte[] aXML,
Charset aCharset) |
PhotonUnifiedResponse |
xml(com.helger.xml.microdom.IMicroNode aNode) |
PhotonUnifiedResponse |
xml(com.helger.xml.microdom.IMicroNode aNode,
com.helger.xml.serialize.write.IXMLWriterSettings aSettings) |
PhotonUnifiedResponse |
xml(Node aNode) |
PhotonUnifiedResponse |
xml(Node aNode,
com.helger.xml.serialize.write.IXMLWriterSettings aSettings) |
PhotonUnifiedResponse |
xml(String sXML,
Charset aCharset) |
addCookie, addCustomResponseHeader, addCustomResponseHeaders, applyToResponse, cacheControl, createSimple, disableCaching, enableCaching, getAllCookies, getCharset, getContentDispositionFilename, getContentDispositionType, getHttpMethod, getHttpVersion, getLogPrefix, getMimeType, getRequestBrowserInfo, getRequestURL, getStatusCode, hasContent, hasCookies, isAllowContentOnRedirect, isAllowContentOnStatusCode, isHttpHeaderValuesQuoteIfNecessary, isHttpHeaderValuesUnified, isRedirectDefined, isSilentMode, isStatusCodeDefined, isWarnOnDuplicateCookies, logError, logInfo, logWarn, removeAllCookies, removeCacheControl, removeCaching, removeCharset, removeContent, removeContentDispositionFilename, removeCookie, removeCustomResponseHeaders, removeETag, removeExpires, removeLastModified, removeMimeType, removeStrictTransportSecurity, removeXFrameOptions, responseHeaderMap, setAllowContentOnRedirect, setAllowContentOnStatusCode, setAllowMimeSniffing, setCacheControl, setCharset, setContent, setContent, setContent, setContentAndCharset, setContentDispositionFilename, setContentDispositionType, setCustomResponseHeader, setCustomResponseHeaders, setDownloadFilename, setEmptyContent, setEnableXSSFilter, setETag, setETagIfApplicable, setExpires, setHttpHeaderValuesQuoteIfNecessary, setHttpHeaderValuesUnified, setLastModified, setMimeType, setMimeTypeString, setRedirect, setRedirect, setRedirect, setRedirect, setRequestBrowserInfo, setSilentMode, setStatus, setStatusUnauthorized, setStrictTransportSecurity, setWarnOnDuplicateCookies, setXFrameOptions, showRequestInfoprotected final com.helger.web.scope.IRequestWebScopeWithoutResponse getRequestScope()
@Nonnull public final com.helger.xml.serialize.write.IXMLWriterSettings getXMLWriterSettings()
public final void setXMLWriterSettings(@Nonnull com.helger.xml.serialize.write.IXMLWriterSettings aXWS)
@Nonnull public final com.helger.json.serialize.IJsonWriterSettings getJsonWriterSettings()
public final void setJsonWriterSettings(@Nonnull com.helger.json.serialize.IJsonWriterSettings aJWS)
@Nonnull public PhotonUnifiedResponse jsonEmpty()
@Nonnull public PhotonUnifiedResponse json(@Nullable com.helger.json.IJson aValue)
@Nonnull public PhotonUnifiedResponse xml(@Nonnull byte[] aXML, @Nonnull Charset aCharset)
@Nonnull public PhotonUnifiedResponse xml(@Nullable com.helger.xml.microdom.IMicroNode aNode)
@Nonnull public PhotonUnifiedResponse xml(@Nullable com.helger.xml.microdom.IMicroNode aNode, @Nonnull com.helger.xml.serialize.write.IXMLWriterSettings aSettings)
@Nonnull public PhotonUnifiedResponse xml(@Nullable Node aNode)
@Nonnull public PhotonUnifiedResponse xml(@Nullable Node aNode, @Nonnull com.helger.xml.serialize.write.IXMLWriterSettings aSettings)
@Nonnull public PhotonUnifiedResponse text(@Nullable String sValue)
@Nonnull public PhotonUnifiedResponse html(@Nullable com.helger.html.hc.IHCNode aNode)
@Nonnull public PhotonUnifiedResponse html(@Nullable com.helger.html.hc.IHCHasChildrenMutable<?,? super com.helger.html.hc.IHCNode> aNode, @Nullable com.helger.html.hc.config.IHCOnDocumentReadyProvider aOnDocumentReadyProvider, @Nullable com.helger.json.IJsonObject aCustomJson)
@Nonnull public PhotonUnifiedResponse htmlSimple(@Nullable com.helger.html.hc.IHCNode aNode)
aNode - The node to be rendered. May be null.@Nonnull public PhotonUnifiedResponse createOk()
@Nonnull public PhotonUnifiedResponse createAccepted()
@Nonnull public PhotonUnifiedResponse createNoContent()
@Nonnull public PhotonUnifiedResponse createSeeOther(@Nonnull com.helger.commons.url.ISimpleURL aRedirectTargetURL)
aRedirectTargetURL - The redirect URL. May not be null.@Nonnull public PhotonUnifiedResponse createBadRequest()
@Nonnull public PhotonUnifiedResponse createNotFound()
@Nonnull public PhotonUnifiedResponse createConflict()
@Nonnull public PhotonUnifiedResponse createPreconditionFailed()
@Nonnull public PhotonUnifiedResponse createInternalServerError()
@Nonnull public PhotonUnifiedResponse setContent(@Nonnull com.helger.commons.io.stream.NonBlockingByteArrayOutputStream aBAOS)
@Nonnull public PhotonUnifiedResponse serialized(@Nonnull Serializable aObj)
@Nonnull public PhotonUnifiedResponse pdf(@Nonnull com.helger.commons.io.stream.NonBlockingByteArrayOutputStream aBAOS)
@Nonnull public PhotonUnifiedResponse pdf(@Nonnull byte[] aData, @Nonnull @Nonempty String sFilename)
@Nonnull public PhotonUnifiedResponse pdf(@Nonnull com.helger.commons.io.stream.NonBlockingByteArrayOutputStream aBAOS, @Nonnull @Nonempty String sFilename)
@Nonnull public PhotonUnifiedResponse attachment(@Nonnull @Nonempty String sFilename)
@Nonnull public PhotonUnifiedResponse binary(@Nonnull com.helger.commons.io.stream.NonBlockingByteArrayOutputStream aBAOS, @Nonnull com.helger.commons.mime.IMimeType aMimeType, @Nonnull @Nonempty String sFilename)
@Nonnull public static PhotonUnifiedResponse createSimple(@Nonnull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope)
aRequestScope - The current request scope. May not be null.PhotonUnifiedResponse. Never null.Copyright © 2014–2023 Philip Helger. All rights reserved.