code: @Override
    public void writePreCommitResponse(int statusCode) throws Exception {
      getRequest().setAttribute("messages", getMessages());
      if (statusCode == StatusCode.OK) {
        if (getRedirectURL() != null) {
          getResponse().setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
          getResponse().setHeader("Location", getRedirectURL());
        }
        else if (getIncludeJSP() != null) {
          getRequest().getRequestDispatcher(getIncludeJSP()).include(getRequest(), getResponse());
        }
        else if (getIncludeFtl() != null) {
          try {
            getRequest().getRequestDispatcher(getIncludeFtl()).include(getRequest(), getResponse());
          } catch (Exception e) {
            // Freemarker templates handle their own errors
            getResponse().setStatus(500);
          }
        } 
      }
      else {
        getRequest().setAttribute("statusCode", statusCode);
        getRequest().setAttribute("messages", getMessages());
        getRequest().getRequestDispatcher(errorJspPage).include(getRequest(), getResponse());
      }
    }
docs: Writes the response to the page request.
  <br><br>
  If the status code of this context is not {@link StatusCode#OK}, a redirect to the generic
  error page is done with the following request attributes:
  <br><br>
  <code>statusCode</code> identifying the error in question<br>
  <code>errorLevel</code> stating the severity of the error<br>
  <code>errorMessage</code> stating what went wrong<br>
  <code>exception</code> itself, if it was set to this context<br>
  <br><br>
  If the status code of this context is {@link StatusCode#OK}, the response either redirects to
  the URL specified in this context, or includes the specified JSP page in the response.
  
  @throws Exception If writing the response fails for any reason