[英]resource files under webapp/WEB-INF or src/main/resources?
In my project i see some xmls under src/main/webapp/WEB-INF
while some under src/main/resources
. 在我的项目中,我在
src/main/webapp/WEB-INF
下看到一些xml,而在src/main/resources
下看到一些。 Is there any convention what kind of file should go under these location 有没有约定在这些位置下应该放哪种文件
src/main/resources contains Application/Library resources. src / main / resources包含应用程序/库资源。
The Servlet 2.4 specification says this about WEB-INF: Servlet 2.4规范说明了有关WEB-INF的信息:
A special directory exists within the application hierarchy named WEB-INF. 在应用程序层次结构中存在一个特殊目录,名为WEB-INF。 This directory contains all things related to the application that aren't in the document root of the application.
此目录包含与应用程序相关的所有内容,这些内容不在应用程序的文档根目录中。 The WEB-INF node is not part of the public document tree of the application.
WEB-INF节点不是应用程序的公共文档树的一部分。 No file contained in the WEB-INF directory may be served directly to a client by the container.
容器不能将WEB-INF目录中包含的文件直接提供给客户端。 However, the contents of the WEB-INF directory are visible to servlet code using the getResource and getResourceAsStream method calls on the ServletContext, and may be exposed using the RequestDispatcher calls.
但是,使用ServletContext上的getResource和getResourceAsStream方法调用,Servlet代码可以看到WEB-INF目录的内容,并且可以使用RequestDispatcher调用公开WEB-INF目录的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.