Author: julien_viet
Date: 2012-02-02 13:39:04 -0500 (Thu, 02 Feb 2012)
New Revision: 8362
Modified:
components/wci/trunk/wci/src/main/java/org/gatein/wci/endpoint/EndPointServlet.java
Log:
GTNWCI-31 : Configure no schema validation on EndPointServlet web.xml parsing
Modified:
components/wci/trunk/wci/src/main/java/org/gatein/wci/endpoint/EndPointServlet.java
===================================================================
---
components/wci/trunk/wci/src/main/java/org/gatein/wci/endpoint/EndPointServlet.java 2012-02-02
16:54:19 UTC (rev 8361)
+++
components/wci/trunk/wci/src/main/java/org/gatein/wci/endpoint/EndPointServlet.java 2012-02-02
18:39:04 UTC (rev 8362)
@@ -44,6 +44,7 @@
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
+import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.io.InputStream;
@@ -122,7 +123,13 @@
//
try
{
- Document doc =
XMLTools.getDocumentBuilderFactory().newDocumentBuilder().parse(new
ByteArrayInputStream(bytes));
+ DocumentBuilderFactory factory = XMLTools.getDocumentBuilderFactory();
+ factory.setValidating(false);
+
factory.setFeature("http://xml.org/sax/features/namespaces", false);
+
factory.setFeature("http://xml.org/sax/features/validation", false);
+
factory.setFeature("http://apache.org/xml/features/nonvalidating/loa...;,
false);
+
factory.setFeature("http://apache.org/xml/features/nonvalidating/loa...;,
false);
+ Document doc = factory.newDocumentBuilder().parse(new
ByteArrayInputStream(bytes));
//
NodeList nodes = (NodeList)expr.evaluate(doc, XPathConstants.NODESET);