3
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>
페이지
가 제대로 web.xml 파일에 구성되어<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/uncaughtException</location>
</error-page>
모든 추측을 내가 부족 무엇으로?
흥미롭게도 충분히 감사합니다. Spring Roo 프로젝트에서이 코드를 가져 왔습니다. 동일한 오류가 발생하는 것으로 보입니다. –
방금 Roo가 생성 한 예외 페이지를 적용 해 보았는데 동일한 문제로이 질문을 발견했습니다. Roo는 [SimpleMappingExceptionResolver] (http://static.springsource.org/spring/docs/3.0.5.RELEASE/javadoc-api/org/springframework/web/servlet/handler/SimpleMappingExceptionResolver.html)를 사용하여 " 예외 "가 해당 뷰에 매핑됩니다. –