tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kin...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Collector.java Generator.java PageInfo.java
Date Wed, 21 Aug 2002 01:53:28 GMT
kinman      2002/08/20 18:53:28

  Modified:    jasper2/src/share/org/apache/jasper/compiler Collector.java
                        Generator.java PageInfo.java
  Log:
  - Silently catch SkipPageException when the page has a tag handler from
    tag file.
  
  Revision  Changes    Path
  1.4       +12 -7     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Collector.java
  
  Index: Collector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Collector.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Collector.java	16 Jul 2002 19:30:51 -0000	1.3
  +++ Collector.java	21 Aug 2002 01:53:28 -0000	1.4
  @@ -75,11 +75,8 @@
   public class Collector {
   
       /**
  -     * A visitor for collection info on the page
  -     * Info collected so far:
  -     *   Maximum tag nestings.
  -     *   Whether a page or a tag element (and its body) contains any scripting
  -     *       elements.
  +     * A visitor for collecting information on the page and the body of
  +     * the custom tags.
        */
       static class CollectVisitor extends Node.Visitor {
   
  @@ -90,6 +87,7 @@
   	private boolean includeActionSeen = false;
   	private boolean setPropertySeen = false;
   	private boolean hasScriptingVars = false;
  +	private boolean tagFileSeen = false;
   
   	public void visit(Node.ParamAction n) throws JasperException {
   	    if (n.getValue().isExpression()) {
  @@ -138,6 +136,12 @@
   	}
   
           public void visit(Node.CustomTag n) throws JasperException {
  +
  +	    // Remember if the tag handler is a tag file
  +	    if (n.getTagFileInfo() != null) {
  +		tagFileSeen = true;
  +	    }
  +
               curTagNesting++;
               if (curTagNesting > maxTagNesting) {
                   maxTagNesting = curTagNesting;
  @@ -230,6 +234,7 @@
           public void updatePageInfo(PageInfo pageInfo) {
               pageInfo.setMaxTagNesting(maxTagNesting);
   	    pageInfo.setScriptless(! scriptingElementSeen);
  +	    pageInfo.setHasTagFile(tagFileSeen);
           }
       }
   
  
  
  
  1.73      +7 -3      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.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- Generator.java	20 Aug 2002 15:50:22 -0000	1.72
  +++ Generator.java	21 Aug 2002 01:53:28 -0000	1.73
  @@ -2800,6 +2800,10 @@
        */
       private void generatePostamble(Node.Nodes page) {
           out.popIndent();
  +	if (pageInfo.hasTagFile()) {
  +	    // Silently catch SkipPageException
  +	    out.printil("} catch (javax.servlet.jsp.SkipPageException t) {");
  +	}
           out.printil("} catch (Throwable t) {");
           out.pushIndent();
   
  
  
  
  1.9       +14 -5     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageInfo.java
  
  Index: PageInfo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageInfo.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PageInfo.java	20 Aug 2002 03:52:18 -0000	1.8
  +++ PageInfo.java	21 Aug 2002 01:53:28 -0000	1.9
  @@ -94,8 +94,9 @@
       private boolean elEnabled = true;
       private boolean tagFile = false;
       private boolean isXml = false;
  -    private boolean isXmlSpecified = false;	// true is there is a
  -						// is-xml element
  +    private boolean isXmlSpecified = false;	// true is there is a is-xml
  +						// element in jsp-config
  +    private boolean hasTagFile = false;		// A custom tag is a tag file
       private Vector includePrelude;
       private Vector includeCoda;
   
  @@ -287,5 +288,13 @@
   
       public void setIncludeCoda(Vector coda) {
   	includeCoda = coda;
  +    }
  +
  +    public void setHasTagFile(boolean hasTag) {
  +	hasTagFile = hasTag;
  +    }
  +
  +    public boolean hasTagFile() {
  +	return hasTagFile;
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message