I think you're looking at old code. Make sure you're looking at
dev.java.net, not sf.net.
Here's the current loadConfigurationFile method:
private void loadConfigurationFile(String fileName, DocumentBuilder
db) {
if (!includedFileNames.contains(fileName)) {
if (LOG.isDebugEnabled())
LOG.debug("Loading xwork configuration from: " +
fileName);
includedFileNames.add(fileName);
Document doc = null;
InputStream is = null;
try {
is = getInputStream(fileName);
if (is == null) {
throw new Exception("Could not open file " +
fileName);
}
doc = db.parse(is);
} catch (Exception e) {
final String s = "Caught exception while loading file "
+ fileName;
LOG.error(s, e);
throw new ConfigurationException(s, e);
} finally {
if (is != null) {
try {
is.close();
} catch (IOException e) {
LOG.error("Unable to close input stream", e);
}
}
}
Element rootElement = doc.getDocumentElement();
NodeList children = rootElement.getChildNodes();
int childSize = children.getLength();
for (int i = 0; i < childSize; i++) {
Node childNode = children.item(i);
if (childNode instanceof Element) {
Element child = (Element) childNode;
final String nodeName = child.getNodeName();
if (nodeName.equals("package")) {
addPackage(child);
} else if (nodeName.equals("include")) {
String includeFileName =
child.getAttribute("file");
loadConfigurationFile(includeFileName, db);
}
}
}
if (LOG.isDebugEnabled())
LOG.debug("Loaded xwork configuration from: " +
fileName);
}
}
> -----Original Message-----
> From: Donnerstag, Juergen [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 01, 2004 11:17 AM
> To: [EMAIL PROTECTED]
> Subject: [OS-webwork] xwork.xml <include>
>
>
>
> I am not sure, but I think there is a small bug in xwork
> (class
> com.opensymphony.xwork.config.providers.XmlConfigurationProvider).
>
> Currently packages are read first and then includes. I'm
> using a xwork.xml and webwork-default.xml from one of the
> examples apps (adminapp-0.9 with Hibernate) and the CVS
> version failed to read it. I changed the order (includes
> first, than packages) and now it fine again.
>
> private void loadConfigurationFile(String fileName,
> DocumentBuilder db) throws Exception {
> Document doc = null;
>
> try {
> InputStream is = getInputStream(fileName);
>
> if (is == null) {
> throw new Exception("Could not open file " +
> fileName);
> }
>
> doc = db.parse(is);
> } catch (Exception e) {
> LOG.error("Caught exception while loading file "
> + fileName);
> }
>
> Element rootElement = doc.getDocumentElement();
>
> loadIncludes(rootElement, db);
> loadPackages(rootElement);
> //loadIncludes(rootElement, db);
> }
>
> regards
> Juergen
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills. Sign
> up for IBM's Free Linux Tutorials. Learn everything from the
> bash shell to sys admin. Click now!
> http://ads.osdn.com/?ad_id=1278&alloc_id=3371> &op=click
>
> _______________________________________________
>
> Opensymphony-webwork mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
>
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork