I would like to forward all errors to my Errorsevlet without explicitly specifying all codes. Is there any way to do this?
<error-page> <error-code>400</error-code> <location>/servlet/com.abc.servlet.ErrorServlet</location> </error-page>
** And after reaching the ErrorServlet, how can I get a trace of the error stack in the servlet. So that I can send emails when one error occurs. **
<error-page> <exception-type>java.lang.Throwable</exception-type> <location>/servlet/com.ibm.eisa.servlet.ErrorServlet</location> </error-page>
Try this, all your errors will be caught (500), not 404, etc.
, Servlet 3.0 , , (, 404, 401 ..). <error-code> <exception-type> , <location>.
<error-code>
<exception-type>
<location>
<error-page> <location>/errorServlet</location> </error-page>
, URL-, Tomcat InvokerServlet.
InvokerServlet
, . , list.
stacktrace (, , ), - :
<%@ page isErrorPage="true" import="java.io.*"%> <body> <p>Sorry, there was an error.</p> <!-- The full stacktrace follows:--> <!-- <% if (exception != null) { exception.printStackTrace(new PrintWriter(out)); } %> --> </body>
, , , , Servlet 3.0.
, " " " " XSD, , " " " ".
(, GlassFish) , , , , .
WebLogic 12c, GlassFish. Tomcat.
See: bz.apache.org/bugzilla/show_bug.cgi?id=52135
Source: https://habr.com/ru/post/1732188/More articles:Push / HTTP Server Stream on Windows Mobile / Windows CE - httpOriginal platform structure and link - linqhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1732185/how-can-i-use-vim-syntax-files-to-collapse-single-line-comments-into-one-region&usg=ALkJrhj8TnW7So095gO0riTpC4hZZ4vgKwVB.NET: launching the method only once during the period of use of the application - vb.netWhere are the network boundaries in the Java Connector Architecture (JCA)? - javahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1732189/install-program-that-has-to-be-run-as-administrator&usg=ALkJrhiJCG_XqV5MTpj-6Hs6hlIxV7nP6gSQL select inverted tree - sql-server-2008Объединение двух полей datetime в два отдельных столбца в T-SQL - sqlWin32 GUI: изменение размера диалогового окна - user-interfaceIs Watir Only for Ruby Applications? - automated-testsAll Articles