On 14/10/2020 08:13, Mark Thomas wrote: > On 14/10/2020 01:31, Matt Benson wrote: >> Hello, >> Today I was experimenting with a Servlet ContainerInitializer in which I >> wanted to modify the value of a particular init param, but found that >> Tomcat's ServletContext implementation (ApplicationContext) explicitly >> rejected the override. The Servlet API doesn't seem to suggest that what >> I'm trying to do should not be supported; would a patch (or patches, >> thinking of multiple Tomcat versions) to support this behavior, perhaps >> conditionally, be welcome? If so, what form should such conditional support >> take? > > Just to be clear about what you are trying to do. > > All of this is within a single web application. > > You are trying to use a ServletContainerInitializer (I assume one > deployed as part of the web application so it has been discovered via > the ServiceLoader API in a JAR located under WEB-INF/lib) to override a > ServletContext init parameter that is defined in web.xml. > > Is that correct? > > Mark > (who is off to remind himself what the spec does (and doesn't) say about > this)
The relevant text is in the Javadoc for ServletContext#setInitParameter. The description of the return value effectively states that init parameters may not be overridden. I think it is unlikely that a patch to change this behaviour would be accepted as it is likely that there is an alternative, spec compliant, way to achieve the same ends. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org