Java WEB-INF 是否在 CLASSPATH 中?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/793917/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 19:33:45  来源:igfitidea点击:

Is WEB-INF in the CLASSPATH?

javaclasspathweb-inf

提问by Shyam

Is the WEB-INFfolder in the CLASSPATHof a Java Web application?

WEB-INF文件夹是否在CLASSPATHJava Web 应用程序的 中?

采纳答案by Hyman Leow

I'm assuming you're referring to the /WEB-INFdirectoryin the root of the web application folder structure.

我假设您指的是 Web 应用程序文件夹结构根/WEB-INF目录中的目录。

No, it's not in the classpath.

不,它不在类路径中。

/WEB-INF/classesis on the classpath though, and so are the JAR files in /WEB-INF/lib.

/WEB-INF/classes虽然在类路径上,.jar 文件中的 JAR 文件也是如此/WEB-INF/lib

回答by Thorbj?rn Ravn Andersen

Additionally files in WEB-INF are protected against being requested by the web-container, i.e. they are invisible to the outside world.

此外,WEB-INF 中的文件受到保护,不会被网络容器请求,即它们对外界是不可见的。