You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by pi...@locus.apache.org on 2000/11/01 01:54:00 UTC

cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler TagEndGenerator.java

pierred     00/10/31 16:54:00

  Modified:    jasper/src/share/org/apache/jasper/compiler
                        TagEndGenerator.java
  Log:
  Support for new JSP1.2 PFD feature:
  "Added new TryCatchFinally interface to provide better control over exceptions in tag
  handlers."
  
  TagEndGenerator
  - Added the calls to doCatch() and doFinally() when the tag
    implements the TryCatchFinally interface
  
  Revision  Changes    Path
  1.4       +14 -0     jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/TagEndGenerator.java
  
  Index: TagEndGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/TagEndGenerator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TagEndGenerator.java	2000/10/17 22:59:01	1.3
  +++ TagEndGenerator.java	2000/11/01 00:53:59	1.4
  @@ -65,6 +65,7 @@
   import javax.servlet.jsp.tagext.Tag;
   import javax.servlet.jsp.tagext.IterationTag;
   import javax.servlet.jsp.tagext.BodyTag;
  +import javax.servlet.jsp.tagext.TryCatchFinally;
   
   import org.xml.sax.Attributes;
   
  @@ -113,6 +114,8 @@
   	    IterationTag.class.isAssignableFrom(tagHandlerClass);
           boolean implementsBodyTag = 
   	    BodyTag.class.isAssignableFrom(tagHandlerClass);
  +        boolean implementsTryCatchFinally = 
  +	    TryCatchFinally.class.isAssignableFrom(tagHandlerClass);
   
   	writer.popIndent();
   
  @@ -164,8 +167,19 @@
           //          writer.popIndent();
           /** FIXME: REMOVE END */
   
  +	// TryCatchFinally
  +	if (implementsTryCatchFinally) {
  +	    writer.println("} catch (Throwable t) {");
  +	    writer.pushIndent();
  +	    writer.println(thVarName+".doCatch(t);");
  +	    writer.popIndent();
  +	}
  +
   	writer.println("} finally {");
   	writer.pushIndent();
  +	if (implementsTryCatchFinally) {
  +	    writer.println(thVarName+".doFinally();");
  +	}
   	writer.println(thVarName+".release();");
   	writer.popIndent();
   	writer.println("}");