Class ServletOps


  • public class ServletOps
    extends java.lang.Object
    • Constructor Detail

      • ServletOps

        public ServletOps()
    • Method Detail

      • responseSendError

        public static void responseSendError​(javax.servlet.http.HttpServletResponse response,
                                             int statusCode,
                                             java.lang.String message)
        Send an HTTP error response. Include an optional message in the body (as text/plain), if provided. Note that we do not set a custom Reason Phrase.
        HTTPS/2 does not have a "Reason Phrase".
        Parameters:
        response -
        statusCode -
        message -
      • responseSendError

        public static void responseSendError​(javax.servlet.http.HttpServletResponse response,
                                             int statusCode)
        Send an HTTP response with no body
      • writeMessagePlainTextError

        public static void writeMessagePlainTextError​(javax.servlet.http.HttpServletResponse response,
                                                      java.lang.String message)
      • successNoContent

        public static void successNoContent​(HttpAction action)
      • success

        public static void success​(HttpAction action)
      • successCreated

        public static void successCreated​(HttpAction action)
      • successNotFound

        public static void successNotFound​(HttpAction action)
      • success

        public static void success​(HttpAction action,
                                   int httpStatusCode)
      • successPage

        public static void successPage​(HttpAction action,
                                       java.lang.String message)
      • warning

        public static void warning​(HttpAction action,
                                   java.lang.String string)
      • warning

        public static void warning​(HttpAction action,
                                   java.lang.String string,
                                   java.lang.Throwable thorwable)
      • errorBadRequest

        public static void errorBadRequest​(java.lang.String string)
      • errorNotFound

        public static void errorNotFound()
      • errorNotFound

        public static void errorNotFound​(java.lang.String string)
      • errorNotImplemented

        public static void errorNotImplemented​(java.lang.String msg)
      • errorMethodNotAllowed

        public static void errorMethodNotAllowed​(java.lang.String method)
      • errorMethodNotAllowed

        public static void errorMethodNotAllowed​(java.lang.String method,
                                                 java.lang.String msg)
      • errorForbidden

        public static void errorForbidden()
      • errorForbidden

        public static void errorForbidden​(java.lang.String msg)
      • error

        public static void error​(int statusCode)
      • error

        public static void error​(int statusCode,
                                 java.lang.String string)
      • errorOccurred

        public static void errorOccurred​(java.lang.String message)
      • errorOccurred

        public static void errorOccurred​(java.lang.Throwable ex)
      • errorOccurred

        public static void errorOccurred​(java.lang.String message,
                                         java.lang.Throwable ex)
      • formatForLog

        public static java.lang.String formatForLog​(java.lang.String string)
      • setNoCache

        public static void setNoCache​(HttpAction action)
      • setNoCache

        public static void setNoCache​(javax.servlet.http.HttpServletResponse response)
      • uploadResponse

        public static void uploadResponse​(HttpAction action,
                                          UploadDetails details)
        response to a upload operation of some kind.
      • sendJsonReponse

        public static void sendJsonReponse​(HttpAction action,
                                           JsonValue v)
        Send a JSON value as a 200 response. Null object means no response body and no content-type headers.
      • sendJson

        public static void sendJson​(HttpAction action,
                                    JsonValue jValue)
        Send a JSON value as a 200 response. Null object means no response body and no content-type headers.