What is the best way to get some stack trace information, maybe Exeception.message to my own 500 error page using tomcat, spring, jsf? I would just like the main reason for the manifestation of exeception.
Here is the JSP syntax that I used with Struts. You can probably get this or similar work with JSf.
<!-- Get the exception object --> <c:set var="exception" value="${requestScope['javax.servlet.error.exception']}"/> <!-- Exception message(s) --> <p>${exception.message}</p> <p><c:if test="${not empty exception.cause.message}">${exception.cause.message}</c:if></p> <!-- Stack trace --> <jsp:scriptlet> exception.printStackTrace(new java.io.PrintWriter(out)); </jsp:scriptlet>
My solution for this was -
Declare jsp error page as error page using this -
<%@ page isErrorPage="true"%>
jsp "", , .
<%exception.printStackTrace();%>
Source: https://habr.com/ru/post/1705848/More articles:Vim: need help with a little script code to highlight - scriptinganalytics database - mysqlIntegration of LinkPoint payments with IIS7 w3wp.exe crashes - .netCOM vs WMI to provide information - windowsAutomatically detect serial port configuration? - serial-portUsing a custom encoding scheme instead of a GUID as a primary key - sqlASP.Net MVC and Webservices / Ajax - Which Route to Take? - asp.net-mvcDownloading Libraries in Dr Scheme - lispЕсли сбор бизнес-объектов наследуется от Collection, когда он не расширяет его? - inheritanceAsp.Net Validaterequest False - validationAll Articles