tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/xmlparser XMLEncodingDetector.java
Date Thu, 30 Sep 2004 21:57:09 GMT
luehe       2004/09/30 14:57:09

  Modified:    jasper2/src/share/org/apache/jasper/xmlparser
                        XMLEncodingDetector.java
  Log:
  Log warning when XML prolog cannot be parsed.
  
  The 2 JSP TCK failures reported by Jeanfrancois are due to this, with
  this root cause:
  
    java.lang.ClassNotFoundException: org.apache.xerces.util.SymbolTable
  
  Revision  Changes    Path
  1.8       +6 -1      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/xmlparser/XMLEncodingDetector.java
  
  Index: XMLEncodingDetector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/xmlparser/XMLEncodingDetector.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XMLEncodingDetector.java	17 Mar 2004 19:23:05 -0000	1.7
  +++ XMLEncodingDetector.java	30 Sep 2004 21:57:09 -0000	1.8
  @@ -23,9 +23,13 @@
   import org.apache.jasper.JspCompilationContext;
   import org.apache.jasper.compiler.ErrorDispatcher;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
   
   public class XMLEncodingDetector {
   
  +    private static Log log = LogFactory.getLog(XMLEncodingDetector.class);
  +
       /**
        * Autodetects the encoding of the XML document supplied by the given
        * input stream.
  @@ -51,7 +55,8 @@
               Class.forName("org.apache.xerces.util.SymbolTable");
               Class detectorClass=Class.forName("org.apache.jasper.xmlparser.XercesEncodingDetector");
               detector = (XMLEncodingDetector) detectorClass.newInstance();
  -        } catch(Exception ex ) {
  +        } catch (Exception ex) {
  +            log.warn("Unable to parse XML prolog: Defaulting encoding to UTF8 ", ex);
               detector = new XMLEncodingDetector();
           }
           return detector.getEncodingMethod(fname, jarFile, ctxt, err);
  
  
  

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