You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Christoph Nenning <Ch...@lex-com.net> on 2013/12/30 14:19:56 UTC
issue with devMode changes in 2.3.16
Dear List,
in some applications we use a custom ConfigurationProvider to use our own
stage specific config to enable devMode automatically for development
stages.
In struts 2.3.16 devMode was changed to allow disabling of e.g. config
reloading or resources reloading even when devMode is enabled. That is
done in DefaultBeanSelectionProvider.switchDevMode()
That method looks like this:
private void switchDevMode(LocatableProperties props) {
if ("true".equalsIgnoreCase(props.getProperty(StrutsConstants.
STRUTS_DEVMODE))) {
if (props.getProperty(StrutsConstants.STRUTS_I18N_RELOAD) ==
null) {
props.setProperty(StrutsConstants.STRUTS_I18N_RELOAD,
"true");
}
if (props.getProperty(StrutsConstants.
STRUTS_CONFIGURATION_XML_RELOAD) == null) {
props.setProperty(StrutsConstants.
STRUTS_CONFIGURATION_XML_RELOAD, "true");
}
if (props.getProperty(StrutsConstants.
STRUTS_FREEMARKER_TEMPLATES_CACHE) == null) {
props.setProperty(StrutsConstants.
STRUTS_FREEMARKER_TEMPLATES_CACHE, "false");
}
if (props.getProperty(StrutsConstants.
STRUTS_FREEMARKER_TEMPLATES_CACHE_UPDATE_DELAY) == null) {
props.setProperty(StrutsConstants.
STRUTS_FREEMARKER_TEMPLATES_CACHE_UPDATE_DELAY, "0");
}
// Convert struts properties into ones that xwork expects
props.setProperty(XWorkConstants.DEV_MODE, "true");
For our application the following happens:
- in Dispatcher.init() ConfigurationProviders are instantiated
- init_DefaultProperties() is called before
init_CustomConfigurationProviders()
- When our CustomConfigurationProvider is called, it triggers
switchDevMode()
- at that time DefaultPropertiesProvider has already run and reloading
properties are set to false
- hence the above if statements in switchDevMode() all evaluate to false
and reloading is not enabled.
That means we have to explicitly enable config and resources reloading in
our own ConfigProvider.
Is that behavior intended?
Would you mind to add a note about that to the wiki?
What do you think about another init-param in web.xml to optionally move
init_CustomConfigurationProviders() at the top of init calls?
regards,
Christoph
This Email was scanned by Sophos Anti Virus
Antwort: Re: Re: issue with devMode changes in 2.3.16
Posted by Christoph Nenning <Ch...@lex-com.net>.
> >
> > I mean to add a note when devMode is enabled via a
> > CustomConfigurationProvider that config and resource reloading is not
> > enabled automatically.
> >
> > At least if you don't remove default values.
>
> Can you register an issue for that?
>
>
https://issues.apache.org/jira/browse/WW-4267
regards and a happy new year,
Christoph
This Email was scanned by Sophos Anti Virus
Re: Re: issue with devMode changes in 2.3.16
Posted by Lukasz Lenart <lu...@apache.org>.
2013/12/30 Christoph Nenning <Ch...@lex-com.net>:
>> > Is that behavior intended?
>>
>> Yes, please check version notes
>>
>> https://cwiki.apache.org/confluence/display/WW/Version+Notes+2.3.16
>>
>> > Would you mind to add a note about that to the wiki?
>>
>>
>> https://cwiki.apache.org/confluence/display/WW/devMode#devMode-
>> Pagerenderingisslow
>>
>
> I mean to add a note when devMode is enabled via a
> CustomConfigurationProvider that config and resource reloading is not
> enabled automatically.
>
> At least if you don't remove default values.
Can you register an issue for that?
Thanks in advance
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Antwort: Re: issue with devMode changes in 2.3.16
Posted by Christoph Nenning <Ch...@lex-com.net>.
> > Is that behavior intended?
>
> Yes, please check version notes
>
> https://cwiki.apache.org/confluence/display/WW/Version+Notes+2.3.16
>
> > Would you mind to add a note about that to the wiki?
>
>
> https://cwiki.apache.org/confluence/display/WW/devMode#devMode-
> Pagerenderingisslow
>
I mean to add a note when devMode is enabled via a
CustomConfigurationProvider that config and resource reloading is not
enabled automatically.
At least if you don't remove default values.
IMHO a CustomConfigurationProvider is an elegant way to enable devMode as
you do not need to change struts.xml/properties during deployment. The
current situation makes it less elegant.
regards,
Christoph
This Email was scanned by Sophos Anti Virus
Re: issue with devMode changes in 2.3.16
Posted by Lukasz Lenart <lu...@apache.org>.
2013/12/30 Christoph Nenning <Ch...@lex-com.net>:
> Dear List,
>
>
> in some applications we use a custom ConfigurationProvider to use our own
> stage specific config to enable devMode automatically for development
> stages.
>
> In struts 2.3.16 devMode was changed to allow disabling of e.g. config
> reloading or resources reloading even when devMode is enabled. That is
> done in DefaultBeanSelectionProvider.switchDevMode()
>
> That method looks like this:
>
> private void switchDevMode(LocatableProperties props) {
> if ("true".equalsIgnoreCase(props.getProperty(StrutsConstants.
> STRUTS_DEVMODE))) {
> if (props.getProperty(StrutsConstants.STRUTS_I18N_RELOAD) ==
> null) {
> props.setProperty(StrutsConstants.STRUTS_I18N_RELOAD,
> "true");
> }
> if (props.getProperty(StrutsConstants.
> STRUTS_CONFIGURATION_XML_RELOAD) == null) {
> props.setProperty(StrutsConstants.
> STRUTS_CONFIGURATION_XML_RELOAD, "true");
> }
> if (props.getProperty(StrutsConstants.
> STRUTS_FREEMARKER_TEMPLATES_CACHE) == null) {
> props.setProperty(StrutsConstants.
> STRUTS_FREEMARKER_TEMPLATES_CACHE, "false");
> }
> if (props.getProperty(StrutsConstants.
> STRUTS_FREEMARKER_TEMPLATES_CACHE_UPDATE_DELAY) == null) {
> props.setProperty(StrutsConstants.
> STRUTS_FREEMARKER_TEMPLATES_CACHE_UPDATE_DELAY, "0");
> }
> // Convert struts properties into ones that xwork expects
> props.setProperty(XWorkConstants.DEV_MODE, "true");
>
>
> For our application the following happens:
> - in Dispatcher.init() ConfigurationProviders are instantiated
> - init_DefaultProperties() is called before
> init_CustomConfigurationProviders()
> - When our CustomConfigurationProvider is called, it triggers
> switchDevMode()
> - at that time DefaultPropertiesProvider has already run and reloading
> properties are set to false
> - hence the above if statements in switchDevMode() all evaluate to false
> and reloading is not enabled.
>
>
> That means we have to explicitly enable config and resources reloading in
> our own ConfigProvider.
>
>
> Is that behavior intended?
Yes, please check version notes
https://cwiki.apache.org/confluence/display/WW/Version+Notes+2.3.16
> Would you mind to add a note about that to the wiki?
https://cwiki.apache.org/confluence/display/WW/devMode#devMode-Pagerenderingisslow
> What do you think about another init-param in web.xml to optionally move
> init_CustomConfigurationProviders() at the top of init calls?
hmm... I'd rather say to remove default values from default.properties
/ struts-default.xml
Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org