<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How can I configure a special error page for a certain exception</title><link>https://answers.axonivy.com/questions/1110/how-can-i-configure-a-special-error-page-for-a-certain-exception</link><description>&lt;p&gt;I want to configure a error page that is shown if a certain exception occurs in Axon.ivy. How can I do that?&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1110/how-can-i-configure-a-special-error-page-for-a-certain-exception" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 09 Jan 2015 08:53:52 -0500</lastBuildDate><item><title>Answer by Reto Weiss</title><link>https://answers.axonivy.com/questions/1110/how-can-i-configure-a-special-error-page-for-a-certain-exception/1111</link><description>&lt;p&gt;You can configure error pages in the &lt;code&gt;web.xml&lt;/code&gt; located in folder /webapps/ivy/WEB-INF. Add the following configuration:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt; error-page &amp;gt;
    &amp;lt; exception-type &amp;gt;java.lang.Throwable&amp;lt; exception-type &amp;gt;
    &amp;lt; location &amp;gt;/myErrorPage.xhtml&amp;lt; location &amp;gt;
&amp;lt; error-page &amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Replace &lt;code&gt;java.lang.Throwable&lt;/code&gt; with the exception class for which you want to have a special error page.&lt;/p&gt;
&lt;p&gt;Another possiblity is to use the normal error page already configured (e.g. &lt;code&gt;ivy-error-page.xhtml&lt;/code&gt;) and change it so that it displays different messages for different exception types. In the error page you have access to the &lt;code&gt;errorPage&lt;/code&gt; variable that is of type &lt;code&gt;ch.ivyteam.ivy.webserver.ErrorPageMBean&lt;/code&gt;. The errorPage variable provides access to the exception object that causes the error handling. With this information you can switch the error page output depending on the exception type.&lt;/p&gt;
&lt;p&gt;More information about error page and error handling can be found &lt;a href="http://developer.axonivy.com/doc/latest/EngineGuideHtml/configuration.html#configuration-errorhandling"&gt;here&lt;/a&gt;. &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Fri, 09 Jan 2015 08:53:52 -0500</pubDate><guid>https://answers.axonivy.com/questions/1110/how-can-i-configure-a-special-error-page-for-a-certain-exception/1111</guid></item></channel></rss>