luehe       2002/10/04 12:21:44

  Modified:    jasper2/src/share/org/apache/jasper/compiler Generator.java
               jasper2/src/share/org/apache/jasper/runtime
                        PageContextImpl.java
  Log:
  Fixed regression (caused by fix for 12638), which prevented error pages in HTML
  format from being displayed properly.
  
  Revision  Changes    Path
  1.107     +6 -4      
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.106
  retrieving revision 1.107
  diff -u -r1.106 -r1.107
  --- Generator.java    3 Oct 2002 23:50:11 -0000       1.106
  +++ Generator.java    4 Oct 2002 19:21:44 -0000       1.107
  @@ -492,8 +492,10 @@
        if (pageInfo.isSession())
            out.printil("HttpSession session = null;");
   
  -     if (pageInfo.isIsErrorPage())
  +     if (pageInfo.isIsErrorPage()) {
               out.printil("Throwable exception = (Throwable) 
request.getAttribute(\"javax.servlet.jsp.jspException\");");
  +         out.printil("request.setAttribute(\"javax.servlet.error.exception\", 
exception);");
  +     }
   
        out.printil("ServletContext application = null;");
        out.printil("ServletConfig config = null;");
  
  
  
  1.26      +10 -5     
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- PageContextImpl.java      4 Oct 2002 00:30:48 -0000       1.25
  +++ PageContextImpl.java      4 Oct 2002 19:21:44 -0000       1.26
  @@ -554,9 +554,14 @@
   
        if (errorPageURL != null && !errorPageURL.equals("")) {
   
  -         // Set request attributes
  +         // Set request attributes.
  +         // Do not set the javax.servlet.error.exception attribute here
  +         // (instead, set in the generated servlet code for the error page)
  +         // in order to prevent the ErrorReportValve, which is invoked as
  +         // part of forwarding the request to the error page, from 
  +         // throwing it if the response has not been committed (the response
  +         // will have been committed if the error page is a JSP page).
            request.setAttribute("javax.servlet.jsp.jspException", t);
  -         request.setAttribute("javax.servlet.error.exception", t);
            request.setAttribute("javax.servlet.error.status_code",
                new Integer(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
            request.setAttribute("javax.servlet.error.request_uri",
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to