62

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.

2
  • META-INF/services/ essentially contains code, if in a rather minimalist, specialist language. Commented Mar 28, 2009 at 16:09
  • Duplicate question which was asked in a much better way: stackoverflow.com/questions/19786142/… Commented Feb 18, 2016 at 9:57

5 Answers 5

49

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.

Sign up to request clarification or add additional context in comments.

2 Comments

What's wrong with sticking with META-INF then? Why invent WEB-INF when META-INF already serves the needed purpose?
@Pacerier: Separation of concerns. WEB-INF is accessible as web resource. I.e. ServletContext#getResource()/getResourceAsStream() can access it as well as ServletRequest#getRequestDispatcher(). META-INF isn't accessible as web resource and shouldn't be. I.e. you shouldn't put web resources like JSP files there.
18

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.

3 Comments

@jon skeet : change the tags if you wish
Looks like it's been done - will edit the answer now so it still makes sense :)
(Is there now any point in having this answer as well as Andy White's? I'm tempted to delete.)
11

It's a directory to store private application content. Anything your app needs but your client doesn't can be stored there. Anything in that directory is not visible to the web.

Source:

http://tomcat.apache.org/tomcat-7.0-doc/appdev/source.html#Directory_Structure http://docs.oracle.com/cd/E13222_01/wls/docs70/webapp/basics.html#136976

1 Comment

This doesn't really answer the question of what WEB-INF actually stands for.
6

I think, the only logical definition is WEB-INF is mirror of META-INF. Naming is really important for beginners and if it is confusing then the subject is getting harder to understand.

Comments

3

The WEB_INF folder contains the web.xml (deployment descriptor) file, the classes, external libs etc and as web.xml file contains the information about the container urls, files etc, the folder is known as WEB-INF.

2 Comments

This doesn't really answer the question of what WEB-INF actually stands for.
A better answer was added and accepted :) Quoting @andy-white 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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.