如何禁用 Tomcat JARScanner [英] How to disable Tomcat JARScanner

查看:33
本文介绍了如何禁用 Tomcat JARScanner的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何:禁用 Tomcat JARScanner?
原因: 停止 Tomcat 扫描我的 LIB 文件夹中的每个 .jar.

How: To disable Tomcat JARScanner?
Why: To stop Tomcat scan every .jar in my LIB folder.

根据文档,它说它可以在 context.xml 中禁用它.但它似乎不起作用.(可能是我遗漏了什么)我在论坛中进行了详尽的搜索,但找不到解决方案.

According to documentation it says that it is possible to disable it within context.xml. But it seems to not be working. (May be I am missing something) I made an exhaustive search in forums and could not find the solution.

这是在 context.xml 中(尚未工作):

This is in context.xml (not working yet):

<JarScanner scanClassPath="false" scanAllFiles="false" scanAllDirectories="false"></JarScanner>

提前致谢.

推荐答案

您应该将 JarScanner 元素添加为 context.xml 文件中根 Context 元素的子元素.

You should add the JarScanner element as a child of the root Context element in the context.xml file.

我在 war 文件中有这种 META-INF/context.xml 文件用于禁用 JarScanner:

I have this kind of META-INF/context.xml file in the war file for disabling the JarScanner:

<?xml version="1.0" encoding="UTF-8"?>
<Context>
    <JarScanner scanClassPath="false" scanAllFiles="false" scanAllDirectories="false"/>
</Context>

这篇关于如何禁用 Tomcat JARScanner的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆