craigmcc 2002/07/23 17:47:23
Modified: src/share/org/apache/struts/action ActionServlet.java
Log:
Pass a SAX InputSource, with a system identifier, to the Digester used to
parse struts-config.xml files. This allows struts-config.xml to use relative
references to other XML files within the WEB-INF subdirectory, in order to
partition the contents into multiple individual files.
Revision Changes Path
1.117 +9 -5
jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java
Index: ActionServlet.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -r1.116 -r1.117
--- ActionServlet.java 24 Jul 2002 00:30:24 -0000 1.116
+++ ActionServlet.java 24 Jul 2002 00:47:23 -0000 1.117
@@ -114,6 +114,7 @@
import org.apache.struts.util.MessageResourcesFactory;
import org.apache.struts.util.RequestUtils;
import org.apache.struts.util.ServletContextWriter;
+import org.xml.sax.InputSource;
/**
@@ -852,8 +853,11 @@
Digester digester = initConfigDigester();
digester.push(config);
+ URL url = getServletContext().getResource(path);
+ InputSource is = new InputSource(url.toExternalForm());
input = getServletContext().getResourceAsStream(path);
- digester.parse(input);
+ is.setByteStream(input);
+ digester.parse(is);
input.close();
getServletContext().setAttribute
(Action.APPLICATION_KEY + prefix, config);
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>