DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36127>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36127

           Summary: validation with xerces 2.7.1
           Product: Tomcat 5
           Version: 5.5.9
          Platform: All
               URL: http://pastebin.com/333771
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


Hi,

When using Tomcat with the last xerces version (2.7.1), there is a problem on
jsp validation. (Note that next Tomcat version will have also 2.7.1 version (as
it was put in the changelog) in current CVS tree).

One way to fix it is in the org/apache/jasper/compiler/JspDocumentParser.java 
file.
By replacing :

        factory.setFeature(
            "http://xml.org/sax/features/validation";,
            validating);

by :

       factory.setValidating(validating);

(Patch at the end)

Note that the setValidating() method is also used by digester which is used by
Tomcat as other places.
See getFactory() method.
http://cvs.apache.org/viewcvs.cgi/jakarta-commons/digester/src/java/org/apache/commons/digester/Digester.java?view=markup

I provide a sample (you could extract the xml snippet if you want to test it in
Tomcat directly without the sample Class).
I tried this example with Sun JDK 1.4.2_08, JDK 5_update4 and with xerces 2.6.2
and 2.7.1 (with endorsed java -Djava.endorsed.dirs=...) and with 
factory.setValidating(validating); it works in all cases. (like in Digester).


It will be fine if it could be fixed in CVS for next Tomcat version.

Regards,

Florent


Index: JspDocumentParser.java
===================================================================
RCS file:
/home/cvspublic/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java,v
retrieving revision 1.84
diff -u -r1.84 JspDocumentParser.java
--- JspDocumentParser.java      30 Mar 2005 20:27:22 -0000      1.84
+++ JspDocumentParser.java      10 Aug 2005 15:22:04 -0000
@@ -1370,9 +1370,10 @@
         factory.setFeature(
             "http://xml.org/sax/features/namespace-prefixes";,
             true);
-        factory.setFeature(
-            "http://xml.org/sax/features/validation";,
-            validating);
+        factory.setValidating(validating);
 
         // Configure the parser
         SAXParser saxParser = factory.newSAXParser();

 
         // Configure the parser
         SAXParser saxParser = factory.newSAXParser();

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

Reply via email to