tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From man...@hyperreal.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/jasper/runtime JspServlet.java PageContextImpl.java
Date Sun, 17 Oct 1999 22:21:33 GMT
mandar      99/10/17 15:21:32

  Modified:    src/share/org/apache/jasper/compiler
                        JspParseEventListener.java
               src/share/org/apache/jasper/runtime JspServlet.java
                        PageContextImpl.java
  Log:
  spec compliance:
    errorPage mechanism uses pageContext.handlePageException(ex);
  
  Revision  Changes    Path
  1.2       +6 -11     jakarta-tomcat/src/share/org/apache/jasper/compiler/JspParseEventListener.java
  
  Index: JspParseEventListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JspParseEventListener.java	1999/10/09 00:20:36	1.1
  +++ JspParseEventListener.java	1999/10/17 22:21:31	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
1.1 1999/10/09 00:20:36 duncan Exp $
  - * $Revision: 1.1 $
  - * $Date: 1999/10/09 00:20:36 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
1.2 1999/10/17 22:21:31 mandar Exp $
  + * $Revision: 1.2 $
  + * $Date: 1999/10/17 22:21:31 $
    *
    * ====================================================================
    * 
  @@ -310,17 +310,12 @@
   
       private void generateFooter() throws JasperException {
   	writer.popIndent();
  -	writer.println("} catch (Throwable t) {");
  +	//writer.println("} catch (Throwable t) {");
  +	writer.println("} catch (Exception ex) {");
   	writer.pushIndent();
           writer.println("if (out.getBufferSize() != 0)");
           writer.pushIndent(); writer.println("out.clear();"); writer.popIndent();
  -	if (!error.equals("") && !ctxt.isErrorPage())
  -	    writer.println("throw new HandleErrorPageException("+"\""+error+"\", t, out);");
  -	else {
  -            writer.println("throw new JasperException(t);");
  -        }
  -        
  -	/* Do something reasonable for errpages and stuff here... */
  +	writer.println("pageContext.handlePageException(ex);");
   	writer.popIndent();
   	writer.println("} finally {");
   	writer.pushIndent();
  
  
  
  1.3       +3 -5      jakarta-tomcat/src/share/org/apache/jasper/runtime/JspServlet.java
  
  Index: JspServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspServlet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JspServlet.java	1999/10/15 00:11:56	1.2
  +++ JspServlet.java	1999/10/17 22:21:32	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspServlet.java,v
1.2 1999/10/15 00:11:56 akv Exp $
  - * $Revision: 1.2 $
  - * $Date: 1999/10/15 00:11:56 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/JspServlet.java,v
1.3 1999/10/17 22:21:32 mandar Exp $
  + * $Revision: 1.3 $
  + * $Date: 1999/10/17 22:21:32 $
    *
    * ====================================================================
    * 
  @@ -235,8 +235,6 @@
   	    wrapper = new JspServletWrapper(jspUri, isErrorPage);
   	    jsps.put(jspUri, wrapper);
   	}
  -	if (exception != null) 
  -	    request.setAttribute("javax.servlet.jsp.jspException", exception);
   	
   	wrapper.service(request, response, precompile);
       }
  
  
  
  1.3       +15 -5     jakarta-tomcat/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PageContextImpl.java	1999/10/14 04:07:54	1.2
  +++ PageContextImpl.java	1999/10/17 22:21:32	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
1.2 1999/10/14 04:07:54 akv Exp $
  - * $Revision: 1.2 $
  - * $Date: 1999/10/14 04:07:54 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
1.3 1999/10/17 22:21:32 mandar Exp $
  + * $Revision: 1.3 $
  + * $Date: 1999/10/17 22:21:32 $
    *
    * ====================================================================
    * 
  @@ -354,8 +354,18 @@
           return out;
       }
       
  -    public void handlePageException(Exception e) {
  -        /* FIXME: Not yet Implemented */
  +    public void handlePageException(Exception e)
  +    throws IOException, ServletException {
  +	
  +	// set the request attribute with the exception.
  +	request.setAttribute("javax.servlet.jsp.jspException", e);
  +	
  +	if (errorPageURL != null && !errorPageURL.equals("")) {
  +	    forward(errorPageURL);
  +	} // Otherwise throw the exception wrapped inside a ServletException.
  +	else
  +	    throw new ServletException(e.getMessage());
  +	    
       }
   
       protected JspWriter _createOut(int bufferSize, boolean autoFlush) 
  
  
  

Mime
View raw message