How to disable Servlet 3.0 scanning and auto loading of components

前端 未结 3 1022
南笙
南笙 2021-01-18 23:17

We have an application which keeps loading instances of ServletContainerInitializer from our 3rd party libs.

One instance is JerseyServletContainerInitializer and th

3条回答
  •  滥情空心
    2021-01-18 23:41

    I found that neither of the given answers worked.

    The only way to actually filter out 3rd-party SCIs from the classpath turned out to be the containerSciFilter attribute of the Context container (in context.xml), which is defined as

    The regular expression that specifies which container provided SCIs should be filtered out and not used for this context. Matching uses java.util.regex.Matcher.find() so the regular expression only has to match a sub-string of the fully qualified class name of the container provided SCI for it to be filtered out. If not specified, no filtering will be applied.

    In my case, I wanted to filter out stuff like org.eclipse.jetty.apache.jsp.JettyJasperInitializer so I used

提交回复
热议问题