tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler ParserController.java
Date Sun, 28 Nov 2004 21:59:29 GMT
markt       2004/11/28 13:59:29

  Modified:    jasper2/src/share/org/apache/jasper/compiler Tag:
                        tomcat_4_branch ParserController.java
  Log:
  Fix bug 25899 - Encoding for included page is now correctly determined
    when the included page contains a page import directive.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.4.2.6   +5 -7      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java
  
  Index: ParserController.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java,v
  retrieving revision 1.4.2.5
  retrieving revision 1.4.2.6
  diff -u -r1.4.2.5 -r1.4.2.6
  --- ParserController.java	4 Oct 2004 20:10:14 -0000	1.4.2.5
  +++ ParserController.java	28 Nov 2004 21:59:29 -0000	1.4.2.6
  @@ -208,7 +208,8 @@
           }
   
           newEncoding = null;
  -
  +        String pageEncoding = null;
  +        
           // Figure out the encoding of the page
           // xml parser will take care of encoding for
           // page in XML syntax since we pass it a stream
  @@ -219,20 +220,17 @@
                   if (jspReader.matches("page")) {
                       jspReader.skipSpaces();
                       Attributes attrs = Parser.parseAttributes(this, jspReader);
  -                    String attribute = "pageEncoding";
  -                    newEncoding = attrs.getValue("pageEncoding");
  -                    if (newEncoding == null) {
  +                    pageEncoding = attrs.getValue("pageEncoding");
  +                    if (pageEncoding == null) {
                           String contentType = attrs.getValue("contentType");
                           if (contentType != null) {
                               int loc = contentType.indexOf("charset=");
                               if (loc != -1) {
                                   newEncoding = contentType.substring(loc+8);
  -                                return;
                               }
                           }
  -                        if (newEncoding == null)
  -                            newEncoding = "ISO-8859-1";
                       } else {
  +                        newEncoding = pageEncoding;
                           return;
                       }
                   }
  
  
  

---------------------------------------------------------------------
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