mirror of
https://github.com/apache/struts.git
synced 2026-08-11 09:36:57 +00:00
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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user