> >> Hi,
> >>
> >> Do you have a solution to disable devMode in production environment?
> >> Based on some ENV variable or something?
> >
> > Yes, we register a configProvider in web.xml which disables devMode 
based
> > on a system property.
> 
> Can you share source code of the provider?
> 
> 

Due to our 4 staging environments we have a custom configuration library 
which gives us environment specific config. That lib is used in 
struts-config-provider.

Without the lib code would look something like this:



public class DevModeConfigProvider implements ConfigurationProvider {

....

        public void register(ContainerBuilder builder, LocatableProperties 
props)
                throws ConfigurationException
        {
                if ("dev".equals(System.getProperty("environment"))) {
                        props.put("struts.devMode", "true");
                }
        }

....

}



regards,
Christoph

This Email was scanned by Sophos Anti Virus

Reply via email to