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
Is WEB-INF in the CLASSPATH?
提问by Shyam
Is the WEB-INF
folder in the CLASSPATH
of a Java Web application?
该WEB-INF
文件夹是否在CLASSPATH
Java Web 应用程序的 中?
采纳答案by Hyman Leow
I'm assuming you're referring to the /WEB-INF
directoryin the root of the web application folder structure.
我假设您指的是 Web 应用程序文件夹结构根/WEB-INF
目录中的目录。
No, it's not in the classpath.
不,它不在类路径中。
/WEB-INF/classes
is 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 中的文件受到保护,不会被网络容器请求,即它们对外界是不可见的。