You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by alik alikov <al...@rambler.ru.INVALID> on 2022/12/23 05:11:44 UTC

RE: Tomcat 9.0.65 trailing slashes redirects

private Context addWebapp(final Host host, final String url, final String name, final String path, final PluginDescriptor pluginDescriptor, final AddContextListener contextAddListened) { silence(host, url); final PluginManager manager = PluginManager.lookup(getClass().getClassLoader()); final Context ctx = new StandardContext(); ctx.setName(name); ctx.setPath(url); ctx.setDocBase(path); ctx.setParentClassLoader( manager.getPluginClassLoader(pluginDescriptor)); //ctx.setLoader(); // disabling standard WebSockets service initializer to use it manually later on ctx.setContainerSciFilter(Pattern.quote(WsSci.class.getName())); final PluginJarScanner jarScanner = new PluginJarScanner(); jarScanner.setPlugin(pluginDescriptor); jarScanner.setScanClassPath(false); ctx.setJarScanner(jarScanner); ctx.addLifecycleListener(new WebXmlListener()); final ContextConfig ctxCfg = new ContextConfig(); ctx.addLifecycleListener(ctxCfg); // prevent it from looking ( if it finds one - it'll have dup error ) ctxCfg.setDefaultWebXml(tomcat.noDefaultWebXmlPath()); if (contextAddListened != null) { contextAddListened.beforeAdd(ctx); } if (host == null) { tomcat.getHost().addChild(ctx); } else { host.addChild(ctx); } if (contextAddListened != null) { contextAddListened.afterAdd(ctx); } return ctx;
.
21.12.2022, 13:38, Tomcat Users List < mailto:users@tomcat.apache.org users@tomcat.apache.org >