public abstract class ResponseHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
HIDE_STACK_TRACES_PROPERTY
The system property determining the default value for
the
isHideStackTraces() property. |
Constructor and Description |
---|
ResponseHelper() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isHideStackTraces() |
static void |
sendBasicAuthenticationRequired(javax.servlet.http.HttpServletResponse resp,
String realm)
Send an
WWW-Authenticate: Basic realm="<realm>" header and
and authorization required body to the servlet response in order
to tell the client to send a basic authorization header. |
static void |
setNoCacheHeaders(javax.servlet.http.HttpServletResponse resp)
Set the following HTTP headers fields in order to mark the servlet's
output as purely dynamic content not to be cached by any browser.
|
public static String HIDE_STACK_TRACES_PROPERTY
isHideStackTraces()
property.public static boolean isHideStackTraces()
hideStackTraces
- Whether the registered servlets will be covered
by ExceptionShadowingServlet
in order to hide stack traces from clients for security
reasons.
The value is true
or the value
of the system
property, if present.public static final void setNoCacheHeaders(javax.servlet.http.HttpServletResponse resp)
Cache-Control: no-cache Pragma: no-cache Expires: 0
resp
- The servlet response to be marked as dynamic content.public static final void sendBasicAuthenticationRequired(javax.servlet.http.HttpServletResponse resp, String realm) throws IOException
WWW-Authenticate: Basic realm="<realm>"
header and
and authorization required body to the servlet response in order
to tell the client to send a basic authorization header.resp
- The response to send the authorization request on.realm
- The realm matching the regexp ^[a-zA-Z0-9_ -]*$
.IOException
- Upon write errors.Copyright © 2018 Clazzes.org. All rights reserved.