开发者

How to change handling of internal server error?

My application produces an internal server error, running on tomcat it prints a stacktrace with the given error. On Oracle it hides the error and post it to application.log.

Is it possible to change this setting via the deployment descriptor?

500 Internal Server Error

Servlet error: An exception occurred. The current application deployment
descriptors do not allow for including it in this response. 

Please consult the app开发者_如何学运维lication log for details.


You can define error handling pages in your web.xml:

<error-page>
    <error-code>500</error-code>
    <location>/WEB-INF/pages/500.jsp</location>
</error-page>

If the error code is explicitly set by your application make sure it uses response.sendError() and not response.setStatus() because the latter will ignore your custom error pages defined in web.xml

p.s By googling your error message I assume that this is a Java web application running on OAS

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜