2013/12/30 Christoph Nenning <christoph.nenn...@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-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org