Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does WEB-INF stand for in a Java EE web application? [closed]

Most of the places on the internet say it stands for WEB INFormation.

I rather doubt it. The folder contains executables. Information is not a suitable name for it.

like image 599
euphoria83 Avatar asked Mar 28 '09 15:03

euphoria83


People also ask

What is Java WEB-INF?

WEB-INF. This directory, which is contained within the Document Root, is invisible from the web container. It contains all resources needed to run the application, from Java classes, to JAR files and libraries, to other supporting files that the developer does not want a web user to access.

What is Java EE web application?

In the Java EE platform, web components provide the dynamic extension capabilities for a web server. Web components can be Java servlets, web pages implemented with JavaServer Faces technology, web service endpoints, or JSP pages.

Why is WEB-INF secure?

This means that WEB-INF resources are accessible to the resource loader of your Web-Application and not directly visible for the public. This is why a lot of projects put their resources like JSP files, JARs/libraries and their own class files or property files or any other sensitive information in the WEB-INF folder.

What is WEB xml in WEB-INF?

Java web applications use a deployment descriptor file to determine how URLs map to servlets, which URLs require authentication, and other information. This file is named web. xml , and resides in the app's WAR under the WEB-INF/ directory.


2 Answers

As far as I know, "INF" stands for "Information", as you said. It probably was named WEB-INF for similarity with the META-INF directory in JAR files. Sometimes the meaning of a directory changes so much over time that it no longer makes sense. For example, bin directories in Unix/Linux often contain non-binary "executable" files, such as shell scripts.

like image 62
Andy White Avatar answered Oct 09 '22 17:10

Andy White


I believe it's really named WEB-INF to mirror the META-INF directory in a jar file, which contains meta information. I do see what you mean about it being as much about executables as "information" but the main point is that it doesn't contain the documents of the application.

like image 43
Jon Skeet Avatar answered Oct 09 '22 16:10

Jon Skeet