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 Validator.java
Date Tue, 29 Apr 2003 19:54:06 GMT
kinman      2003/04/29 12:54:06

  Modified:    jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  - Allow page encoding be specified both in the including and included
    pages, but still disallow multiple page encodings in the same page.
  
  Revision  Changes    Path
  1.103     +12 -12    jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.102
  retrieving revision 1.103
  diff -u -r1.102 -r1.103
  --- Validator.java	9 Apr 2003 00:47:15 -0000	1.102
  +++ Validator.java	29 Apr 2003 19:54:06 -0000	1.103
  @@ -125,9 +125,6 @@
   	private boolean infoSeen = false;
   	private boolean pageEncodingSeen = false;
   
  -	private Node.Root oldPageDirectiveRoot = null;
  -	private Node.Root currentPageDirectiveRoot = null;
  -
   	/*
   	 * Constructor
   	 */
  @@ -137,16 +134,19 @@
   	    JspCompilationContext ctxt = compiler.getCompilationContext();
   	}
   
  +	public void visit(Node.IncludeDirective n) throws JasperException {
  +            // Since pageDirectiveSeen flag only applies to the Current page
  +            // save it here and restore it after the file is included.
  +            boolean pageEncodingSeenSave = pageEncodingSeen;
  +            pageEncodingSeen = false;
  +            visitBody(n);
  +            pageEncodingSeen = pageEncodingSeenSave;
  +        }
  +
   	public void visit(Node.PageDirective n) throws JasperException {    
   
               JspUtil.checkAttributes("Page directive", n,
                                       pageDirectiveAttrs, err);
  -
  -	    oldPageDirectiveRoot = currentPageDirectiveRoot;
  -	    currentPageDirectiveRoot = n.getRoot();
  -	    if (oldPageDirectiveRoot != currentPageDirectiveRoot) {
  -		pageEncodingSeen = false;
  -	    }
   
   	    // JSP.2.10.1
   	    Attributes attrs = n.getAttributes();
  
  
  

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


Mime
View raw message