WW-1977 Struts throws stack trace instead of 404 when an action doesn't exist

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@566475 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Holmes
2007-08-16 02:57:03 +00:00
parent ccc7b7471c
commit 55ea2ea1d9
@@ -741,12 +741,15 @@ Caused by: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyExcepti
}
} else {
try {
// send a http error response to use the servlet defined error handler
// make the exception availible to the web.xml defined error page
request.setAttribute("javax.servlet.error.exception", e);
// WW-1977: Only put errors in the request when code is a 500 error
if (code == HttpServletResponse.SC_INTERNAL_SERVER_ERROR) {
// send a http error response to use the servlet defined error handler
// make the exception availible to the web.xml defined error page
request.setAttribute("javax.servlet.error.exception", e);
// for compatibility
request.setAttribute("javax.servlet.jsp.jspException", e);
// for compatibility
request.setAttribute("javax.servlet.jsp.jspException", e);
}
// send the error response
response.sendError(code, e.getMessage());