Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is WEB-INF in the CLASSPATH?

Is the WEB-INF folder in the CLASSPATH of a Java Web application?

like image 760
Shyam Avatar asked Apr 27 '09 15:04

Shyam


People also ask

Where is the Web-INF folder?

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.

Is Meta-INF in the classpath?

Re: Is META-INF in the classpath? No, not generally. If its needed you would have to use a META-INF/jboss-structure. xml to instruct the structure deployers to add it.

What is classpath in web application?

The classpath is always set from a source outside the program itself. Separating this responsibility from the program allows the Java code to reference the classes and packages in an abstract manner, allowing the program to be configured for use on any system.

What is the difference between Meta-INF and WEB-INF?

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.


2 Answers

I'm assuming you're referring to the /WEB-INF directory in the root of the web application folder structure.

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.

like image 186
Jack Leow Avatar answered Sep 19 '22 17:09

Jack Leow


Additionally files in WEB-INF are protected against being requested by the web-container, i.e. they are invisible to the outside world.

like image 27
Thorbjørn Ravn Andersen Avatar answered Sep 18 '22 17:09

Thorbjørn Ravn Andersen