In my project i see some xmls under src/main/webapp/WEB-INF
while some under src/main/resources
.
Is there any convention what kind of file should go under these location
The WEB-INF directory contains the deployment descriptors for the Web application (web. xml and weblogic. xml) and two subdirectories for storing compiled Java classes and library JAR files. These subdirectories are respectively named classes and lib.
Web resources are any software artifacts that the web application requires for proper rendering, including images, script files, and any user-created component libraries. Resources must be collected in a standard location, which can be one of the following.
The META-INF directory is private and can't be accessed from the outside. On the other hand, it also contains the WEB-INF public directory with all the static web resources, including HTML pages, images, and JS files. Moreover, it contains the web. xml file, servlet classes, and libraries.
WEB-INF folder is under public_html folder. You can configure and add your content to your site yourself with. class files.
src/main/resources contains Application/Library resources.
The Servlet 2.4 specification says this about WEB-INF:
A special directory exists within the application hierarchy named 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. No file contained in the WEB-INF directory may be served directly to a client by the container. 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With