title: How to configure grails to always show own error page on status 500
body: <p>In <code>UrlMappings.groovy</code>, I have set <code>"500"(controller:'error', action:'error')</code> so that my own error controller (and view) is used.</p>
  
  <p>It usually works, however when I tried tampering with the request input (submitting a parameter with 1MB size), I got a Tomcat generated error page with HTTP Status 500.</p>
  
  <p>First I thought this error was only generated by Tomcat so that grails couldn't do anything about it, but the Exception is an <code>org.springframework.web.util.NestedServletException</code> (nested Exception <code>java.lang.StackOverflowError</code>) and there are many <code>org.codehaus.groovy.grails</code> packaged Classes in the stack trace.</p>
  
  <p>I think showing this Exception including stack trace to potential attackers is dangerous, so how I can I configure grails to always show my own error page? Or is it only possible to configure that in Tomcat?</p>