luehe       2003/03/24 15:50:41

  Modified:    jasper2/src/share/org/apache/jasper/compiler Validator.java
               jasper2/src/share/org/apache/jasper/resources
                        messages.properties
  Log:
  Implemented JSP 2.0 change to page directive:
  
    Support more than one 'pageEncoding' attribute per translation unit,
    but only one per file
  
  Revision  Changes    Path
  1.95      +14 -4     
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.94
  retrieving revision 1.95
  diff -u -r1.94 -r1.95
  --- Validator.java    24 Mar 2003 21:36:05 -0000      1.94
  +++ Validator.java    24 Mar 2003 23:50:40 -0000      1.95
  @@ -124,6 +124,9 @@
        private boolean infoSeen = false;
        private boolean pageEncodingSeen = false;
   
  +     private Node.Root oldPageDirectiveRoot = null;
  +     private Node.Root currentPageDirectiveRoot = null;
  +
        /*
         * Constructor
         */
  @@ -138,6 +141,12 @@
               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();
            for (int i = 0; i < attrs.getLength(); i++) {
  @@ -249,7 +258,8 @@
                    infoSeen = true;
                } else if ("pageEncoding".equals(attr)) {
                    if (pageEncodingSeen) 
  -                     err.jspError(n, "jsp.error.page.multiple.pageencoding");
  +                     err.jspError(n,
  +                                  "jsp.error.page.multiple.pageencoding");
                    pageEncodingSeen = true;
                    /*
                     * Report any encoding conflict, treating "UTF-16",
  
  
  
  1.107     +2 -1      
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties
  
  Index: messages.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties,v
  retrieving revision 1.106
  retrieving revision 1.107
  diff -u -r1.106 -r1.107
  --- messages.properties       21 Mar 2003 00:43:58 -0000      1.106
  +++ messages.properties       24 Mar 2003 23:50:41 -0000      1.107
  @@ -55,6 +55,7 @@
   jsp.error.page.defafteruse.language=Page directive: can't define language after a 
scriptlet 
   jsp.error.page.nomapping.language=Page directive: No mapping for language: 
   jsp.error.page.multiple.extends=Page directive: can't have multiple occurrences of 
extends
  +jsp.error.page.multiple.pageencoding=More than one \'pageEncoding\' page directive 
attribute
   jsp.error.page.bad_b_and_a_combo=Page directive: Illegal combination of 
buffer=\"none\" && autoFlush=\"false\"
   jsp.error.not.impl.taglib=Internal error: Tag extensions not implemented
   jsp.error.include.missing.file=Missing file argument to include
  
  
  

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

Reply via email to