How Do You Setup Custom Error Pages in the web.xml File?

Prior to go-live, it's important to establish custom error pages to prevent unexpected behavior from those pesky 500 HTTP status codes. Although you could perform a similar implementation using the Apache Web Server, you may also configure custom error pages using Hybris Commerce's web.xml file using the following XML snippet:

<error-page>
<error-code>500</error-code>
<location>/WEB-INF/views/mobile/pages/error/ServerError.jsp</location>
</error-page>
<error-page>
<error-code>503</error-code>
<location>/WEB-INF/views/mobile/pages/error/ServerError.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/WEB-INF/views/mobile/pages/error/ServerError.jsp</location>
</error-page>

Marc Raygoza

Marc is the Founder of HybrisArchitect.com.
He enjoys helping others learn more about SAP Hybris Commerce. Marc is a SAP Commerce Certified Professional and has held the role of Hybris Architect at Deloitte, PWC, Exemplis and Nasty Gal. He is a long-time Java/Spring developer. Marc holds an M.S. Software Engineering from Carnegie Mellon University and a B.S. in Accountancy from California State University, Fresno. He can be reached at: info@hybrisarchitect.com

You may also like...

Popular Posts

Leave a Reply

Your email address will not be published. Required fields are marked *