title: Custom Error Page Not Decorated by Sitemesh in Spring Security Application
body: <p>In a Spring MVC (3.2.4) application with Spring Security (3.2.0.RC2) with Sitemesh (2.4.2), the web.xml file has this entry:</p>
  
  <pre><code>&lt;error-page&gt;
      &lt;error-code&gt;403&lt;/error-code&gt;
      &lt;location&gt;/error?code=403&lt;/location&gt;
  &lt;/error-page&gt;
  </code></pre>
  
  <p>which maps to ErrorController:</p>
  
  <pre><code>@RequestMapping("error")
  public String displayErrorPage(
      @RequestParam(value = "code", defaultValue = "0") int code,
      Model model, final HttpServletRequest request, Principal principal) {
      // ...
      return "errorPage";
  }
  </code></pre>
  
  <p>which displays errorPage.jsp via an InternalResourceViewResolver (there are no other view resolvers in the app).</p>
  
  <p>The security works fine and errorPage.jsp is displayed when an unauthorized user tries to access a secured page, but the the page is not decorated. Every other page in the application is decorated without any issues and errorPage.jsp lives in the same directory as other JSPs that are decorated without any problems. This application is using the Servlet 3.0 spec. </p>