[seam-commits] Seam SVN: r8625 - in trunk: src/main/org/jboss/seam/mock and 1 other directory.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Thu Aug 7 11:03:11 EDT 2008
Author: pete.muir at jboss.org
Date: 2008-08-07 11:03:11 -0400 (Thu, 07 Aug 2008)
New Revision: 8625
Modified:
trunk/build/core.pom.xml
trunk/build/root.pom.xml
trunk/src/main/org/jboss/seam/mock/MockServletContext.java
Log:
JBSEAM-3242
Modified: trunk/build/core.pom.xml
===================================================================
--- trunk/build/core.pom.xml 2008-08-07 13:31:33 UTC (rev 8624)
+++ trunk/build/core.pom.xml 2008-08-07 15:03:11 UTC (rev 8625)
@@ -313,12 +313,6 @@
<optional>true</optional>
</dependency>
- <dependency>
- <groupId>jaxen</groupId>
- <artifactId>jaxen</artifactId>
- <optional>true</optional>
- </dependency>
-
</dependencies>
</project>
Modified: trunk/build/root.pom.xml
===================================================================
--- trunk/build/root.pom.xml 2008-08-07 13:31:33 UTC (rev 8624)
+++ trunk/build/root.pom.xml 2008-08-07 15:03:11 UTC (rev 8625)
@@ -876,13 +876,8 @@
</exclusion>
</exclusions>
</dependency>
-
- <dependency>
- <groupId>jaxen</groupId>
- <artifactId>jaxen</artifactId>
- <version>1.1-beta-4</version>
- </dependency>
+
<dependency>
<groupId>org.beanshell</groupId>
<artifactId>bsh</artifactId>
Modified: trunk/src/main/org/jboss/seam/mock/MockServletContext.java
===================================================================
--- trunk/src/main/org/jboss/seam/mock/MockServletContext.java 2008-08-07 13:31:33 UTC (rev 8624)
+++ trunk/src/main/org/jboss/seam/mock/MockServletContext.java 2008-08-07 15:03:11 UTC (rev 8625)
@@ -19,11 +19,10 @@
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
-import org.dom4j.Document;
import org.dom4j.DocumentException;
-import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
+import org.dom4j.Element;
import org.jboss.seam.util.IteratorEnumeration;
+import org.jboss.seam.util.XML;
public class MockServletContext implements ServletContext
{
@@ -60,22 +59,23 @@
private void processContextParameters(URL webXML)
{
- SAXReader reader = new SAXReader();
- Document document;
try
{
- document = reader.read(webXML);
-
- List<Node> nodes = document.selectNodes("//*[name()='context-param']");
- for (Node node : nodes)
+ Element root = XML.getRootElementSafely(webXML.openStream());
+ for (Element element : (List<Element>) root.elements("context-param"))
{
- getInitParameters().put(node.selectSingleNode("*[name()='param-name']").getText(), node.selectSingleNode("*[name()='param-value']").getText());
+ getInitParameters().put(element.elementText("param-name"), element.elementText("param-value"));
}
}
+ catch (IOException e)
+ {
+ throw new RuntimeException("Error parsing web.xml", e);
+ }
catch (DocumentException e)
{
- throw new RuntimeException("Error processing web.xml", e);
+ throw new RuntimeException("Error parsing web.xml", e);
}
+
}
More information about the seam-commits
mailing list