You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (JIRA)" <ji...@apache.org> on 2013/01/14 10:44:12 UTC

[jira] [Updated] (WW-3961) struts.xml include not loading in dependant jar files

     [ https://issues.apache.org/jira/browse/WW-3961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart updated WW-3961:
------------------------------

    Description: 
In "struts.xml" when I include "struts/*.xml" which packaged in "WEB-INF/lib/sys.jar",but didn't load the include files. When I put include files in folder "WEB-INF/cleasses/struts/",it works.
{code:xml}
<include file="struts/*.xml" />
{code}
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider#loadConfigurationFiles(String fileName, Element includeElement)
{code:java}
if ("include".equals(nodeName)) {
String includeFileName = child.getAttribute("file");
if (includeFileName.indexOf('*') != -1) {
	// handleWildCardIncludes(includeFileName, docs, child);
	ClassPathFinder wildcardFinder = new ClassPathFinder();
	wildcardFinder.setPattern(includeFileName);
	Vector<String> wildcardMatches = wildcardFinder.findMatches();
	for (String match : wildcardMatches) {
		finalDocs.addAll(loadConfigurationFiles(match, child));
	}
} else {
	finalDocs.addAll(loadConfigurationFiles(includeFileName, child));
}
}
{code}

  was:
In "struts.xml" when I include "struts/*.xml" which packaged in "WEB-INF/lib/sys.jar",but didn't load the include files. When I put include files in folder "WEB-INF/cleasses/struts/",it works.

<include file="struts/*.xml" />

com.opensymphony.xwork2.config.providers.XmlConfigurationProvider#loadConfigurationFiles(String fileName, Element includeElement)

if ("include".equals(nodeName)) {
String includeFileName = child.getAttribute("file");
if (includeFileName.indexOf('*') != -1) {
	// handleWildCardIncludes(includeFileName, docs, child);
	ClassPathFinder wildcardFinder = new ClassPathFinder();
	wildcardFinder.setPattern(includeFileName);
	Vector<String> wildcardMatches = wildcardFinder.findMatches();
	for (String match : wildcardMatches) {
		finalDocs.addAll(loadConfigurationFiles(match, child));
	}
} else {
	finalDocs.addAll(loadConfigurationFiles(includeFileName, child));
}
}

    
> struts.xml include not loading in dependant jar files
> -----------------------------------------------------
>
>                 Key: WW-3961
>                 URL: https://issues.apache.org/jira/browse/WW-3961
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: XML Configuration
>    Affects Versions: 2.3.4
>            Reporter: yuanhuiwu
>              Labels: include, struts.xml
>
> In "struts.xml" when I include "struts/*.xml" which packaged in "WEB-INF/lib/sys.jar",but didn't load the include files. When I put include files in folder "WEB-INF/cleasses/struts/",it works.
> {code:xml}
> <include file="struts/*.xml" />
> {code}
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider#loadConfigurationFiles(String fileName, Element includeElement)
> {code:java}
> if ("include".equals(nodeName)) {
> String includeFileName = child.getAttribute("file");
> if (includeFileName.indexOf('*') != -1) {
> 	// handleWildCardIncludes(includeFileName, docs, child);
> 	ClassPathFinder wildcardFinder = new ClassPathFinder();
> 	wildcardFinder.setPattern(includeFileName);
> 	Vector<String> wildcardMatches = wildcardFinder.findMatches();
> 	for (String match : wildcardMatches) {
> 		finalDocs.addAll(loadConfigurationFiles(match, child));
> 	}
> } else {
> 	finalDocs.addAll(loadConfigurationFiles(includeFileName, child));
> }
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira