public final class ErrorHandlerServlet
extends javax.servlet.http.HttpServlet
This servlet always returns an error code.
This servlet should be configured as:
<!-- Handler for errors (this servlet does not need to be mapped to anything) --> <servlet> <servlet-name>ErrorHandlerServlet</servlet-name> <servlet-class>org.pageseeder.berlioz.servlet.ErrorHandlerServlet</servlet-class> <load-on-startup>2</load-on-startup> </servlet>
Modifier and Type | Field and Description |
---|---|
static String |
BERLIOZ_ERROR_ID
The Berlioz error ID (String).
|
static String |
ERROR_EXCEPTION
Exception thrown (Exception).
|
static String |
ERROR_EXCEPTION_TYPE
Class of exception thrown (Class).
|
static String |
ERROR_MESSAGE
Any attached message (String).
|
static String |
ERROR_REQUEST_URI
The offending request URI (String) .
|
static String |
ERROR_SERVLET_NAME
The name of offending servlet (String).
|
static String |
ERROR_STATUS_CODE
The HTTP Status code (Integer).
|
Constructor and Description |
---|
ErrorHandlerServlet() |
Modifier and Type | Method and Description |
---|---|
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Handles a GET request.
|
void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Handles a POST request.
|
static void |
handle(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Handle the errors using the fail safe options and templates.
|
void |
init(javax.servlet.ServletConfig config) |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
public static final String ERROR_EXCEPTION
public static final String ERROR_EXCEPTION_TYPE
public static final String ERROR_MESSAGE
public static final String ERROR_REQUEST_URI
public static final String ERROR_SERVLET_NAME
public static final String ERROR_STATUS_CODE
public static final String BERLIOZ_ERROR_ID
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
public void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, IOException
No parameter required.
doGet
in class javax.servlet.http.HttpServlet
req
- The servlet request.res
- The servlet response.javax.servlet.ServletException
- Should a servlet exception occur.IOException
- Should an I/O error occur.public void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, IOException
No parameter required.
doPost
in class javax.servlet.http.HttpServlet
req
- The servlet request.res
- The servlet response.javax.servlet.ServletException
- Should a servlet exception occur.IOException
- Should an I/O error occur.public static void handle(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, IOException
req
- The servlet request.res
- The servlet response.javax.servlet.ServletException
- Should a servlet exception occur.IOException
- Should an I/O error occur.Copyright © 2016 Allette Systems. All rights reserved.