Documentation Center

Suppressing Tomcat servlet errors

You can suppress servlet errors and redirect them to custom error pages.

About this task

To provide user-friendly error pages for your users, you can modify your configuration to suppress the default error messages that are generated from your servlets and web application server and redirect them to custom error pages.

Procedure

  1. In a text editor, open LiveContent_InstallDir\webapp\WEB-INF\web.xml
  2. Add the following init-parameter to the XQueryServlet:
    <servlet>
    ...
        <init-param>
            <param-name>debug</param-name>
            <param-value>false</param-value>
        </init-param> 
    ...
    </servlet>                          
    
  3. Add custom error pages:
    <error-page>
       <error-code>400</error-code>
       <location>/error.html</location>
    </error-page>
    
    <error-page>
       <error-code>401</error-code>
       <location>/error.html</location>
    </error-page>
    
    <error-page>
       <error-code>403</error-code>
       <location>/error.html</location>
    </error-page>
    
    <error-page>
       <error-code>404</error-code>
       <location>/error.html</location>
    </error-page>
    
    <error-page>
       <error-code>500</error-code>
       <location>/error.html</location>
    </error-page>
    
    <error-page>
       <error-code>503</error-code>
       <location>/error.html</location>
    </error-page>
    
  4. Save the file and exit your text editor.
  5. Restart your web application server.