[
https://issues.apache.org/struts/browse/WW-1966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
James Holmes updated WW-1966:
-----------------------------
Affects Version/s: 2.0.7
2.0.8
Fix Version/s: (was: Future)
2.0.10
Summary: "struts.configuration.files" setting does not work in
application-specific struts.properties files (was: struts.configuration.files
doesn't work, or work incorrectly)
I did some research into this and I figured out why changing the
"struts.configuration.files" setting in an application-specific
struts.properties file is not loading the struts-tags.xml file. The reason is
because currently Struts 2 loads the struts*.xml files before it loads in the
application-specific struts.properties file. That means that Struts 2 will
never use the "struts.configuration.files" setting specified in the
application-specific struts.properties file.
On top of that, unless I'm missing something, Struts 2 never even uses the
"struts.configuration.files" setting (even when specified in default.properties
in the Struts 2 core JAR file). This is a bug for sure.
The problem lies in the org.apache.struts2.dispatcher.Dispatcher.init() method.
Currently executes the following:
init_DefaultProperties(); // [1]
init_TraditionalXmlConfigurations(); // [2]
init_LegacyStrutsProperties(); // [3]
init_ZeroConfiguration(); // [4]
...
In order for this issue to be resolved the order needs to be changed so that
application-specific struts.properties files are loaded before struts.xml files.
init_DefaultProperties(); // [1]
init_LegacyStrutsProperties(); // [2] <-- now done 2nd, not 3rd
init_TraditionalXmlConfigurations(); // [3]
init_ZeroConfiguration(); // [4]
...
I don't know what the ramifications of changing the order of loading properties
files versus xml config files are. Anyone else know?
As a side note, the "struts.configuration.files" setting currently will also be
ignored if specified in struts.xml file using a <constant> tag like the
following:
<constant name=""struts.configuration.files"
value="struts-default.xml,struts-plugin.xml,struts.xml,struts-tags.xml"/>
> "struts.configuration.files" setting does not work in application-specific
> struts.properties files
> --------------------------------------------------------------------------------------------------
>
> Key: WW-1966
> URL: https://issues.apache.org/struts/browse/WW-1966
> Project: Struts 2
> Issue Type: Bug
> Components: Configuration
> Affects Versions: 2.0.6, 2.0.7, 2.0.8
> Environment: struts2.0.6
> eclipse3.2 wtp
> tomcat 5.5
> Reporter: Jung Kwang Sun
> Assignee: David Evans
> Fix For: 2.0.10
>
>
> I tested the struts.configuration.files properties for special cases, and
> found a kind of bug.
> With the struts-showcases-2.0.6, I remove the <include
> file="struts-tags.xml"/> line in the struts.xml.
> And add the following line in the struts.properties :
> struts.configuration.files=struts-default.xml,struts-plugin.xml,struts.xml,struts-tags.xml
> Then when I accessed the tags-related action, exception happened(no action or
> result exception)...
> Is this a incorrect attempt? or bug?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.