Kar*_*ran 3 java jsp tomcat spring-mvc
我正在尝试在jsp页面上打印出异常堆栈跟踪.但是,似乎没有填充隐式异常对象.
<div xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:spring="http://www.springframework.org/tags"
xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
<jsp:output omit-xml-declaration="yes"/>
<jsp:directive.page isErrorPage="true" />
<spring:message var="title" code="error_uncaughtexception_title"/>
<h2>${fn:escapeXml(title)}</h2>
<p>
<spring:message code="error_uncaughtexception_problemdescription"/>
</p>
<c:if test="${not empty exception}">
<p>
<h4>
<spring:message code="exception_details"/>
</h4>
<spring:message var="message" code="exception_message"/>
<c:out value="${exception.localizedMessage}"/>
<spring:message var="stacktrace" code="exception_stacktrace"/>
<c:forEach items="${exception.stackTrace}" var="trace">
<c:out value="${trace}"/>
<br/>
</c:forEach>
</p>
</c:if>
Run Code Online (Sandbox Code Playgroud)
该页面在web.xml中正确配置:
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/uncaughtException</location>
</error-page>
Run Code Online (Sandbox Code Playgroud)
有什么猜测我错过了什么?
| 归档时间: |
|
| 查看次数: |
3047 次 |
| 最近记录: |