Implementation of a Valve that outputs HTML error pages.
This Valve should be attached at the Host level, although it will work if attached to a Context.
HTML code from the Cocoon 2 project.
| Modifier and Type | Field and Description |
|---|---|
| private final ErrorPageSupport | |
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected ErrorPage | Returns: the associated error pagethe status code statusCode, Throwable the exception throwable)Return the error page associated with the specified status and exception. |
| protected String | Returns: the stack trace relative to the application layerThe stack trace to process t)Print out a partial servlet stack trace (truncating at the last occurrence of jakarta.servlet.). |
| public String | |
| public void | invoke(Request
The servlet request to be processed request, Response The servlet response to be created response)Implements org. Invoke the next Valve in the sequence. |
| public boolean | |
| public boolean | |
| protected void | |
| private boolean | |
| public boolean | |
| public void | |
| public void | setShowServerInfo(boolean
true to show server infoEnables/Disables server info on error pages |
| errorPageSupport | back to summary |
|---|---|
| private final ErrorPageSupport errorPageSupport | |
| showReport | back to summary |
|---|---|
| private boolean showReport | |
| showServerInfo | back to summary |
|---|---|
| private boolean showServerInfo | |
| ErrorReportValve | back to summary |
|---|---|
| public ErrorReportValve() | |
| findErrorPage | back to summary |
|---|---|
| protected ErrorPage findErrorPage(int statusCode, Throwable throwable) Return the error page associated with the specified status and exception. | |
| getPartialServletStackTrace | back to summary |
|---|---|
| protected String getPartialServletStackTrace(Throwable t) Print out a partial servlet stack trace (truncating at the last occurrence of jakarta.servlet.). | |
| getProperty | back to summary |
|---|---|
| public String getProperty(String name) | |
| invoke | back to summary |
|---|---|
| public void invoke(Request request, Response response) throws IOException, ServletException Implements org. Invoke the next Valve in the sequence. When the invoke returns, check the response state. If the status code is greater than or equal to 400 or an uncaught exception was thrown then the error handling will be triggered.
| |
| isShowReport | back to summary |
|---|---|
| public boolean isShowReport() | |
| isShowServerInfo | back to summary |
|---|---|
| public boolean isShowServerInfo() | |
| report | back to summary |
|---|---|
| protected void report(Request request, Response response, Throwable throwable) Prints out an error report. | |
| sendErrorPage | back to summary |
|---|---|
| private boolean sendErrorPage(String location, Response response) | |
| setProperty | back to summary |
|---|---|
| public boolean setProperty(String name, String value) | |
| setShowReport | back to summary |
|---|---|
| public void setShowReport(boolean showReport) Enables/Disables full error reports
| |
| setShowServerInfo | back to summary |
|---|---|
| public void setShowServerInfo(boolean showServerInfo) Enables/Disables server info on error pages
| |