Introduction to WEB-INF

WEB-INF is the security directory of Java WEB applications.

Introduction to WEB-INF
WEB-INF is the security directory of Java WEB applications. The so-called security is a directory that the client cannot access, but only the server can access.
If you want to directly access the files in the page, you must map the files to be accessed through the web.xml file to access them.
In addition to web.xml, there is also a classes folder in the WEB-INF folder to place *.class files. These *.class files are class libraries written by website designers, which realize the front-end art and back-end services of jsp pages. The separation makes the maintenance of the website very convenient. The web.xml file describes the XML file for website deployment and is very important for website deployment.
In the Web-Inf folder, in addition to the classes folder and a web.xml file, there is also a lib folder (for storing the required jar packages) (for configuration, for example, to configure filters, etc.)
The role of the WEB_INF directory
/WEB-INF/web.xml
 
Web application configuration file, which describes the configuration and naming rules for servlets and other application components.
/WEB-INF/classes/
  contains all the class files used by the site, including servlet classes and non-servlet classes, they cannot be included in .jar files (this directory cannot be included in .jar files).
  /WEB-INF/lib/
  stores various JAR files required by web applications, and places jar files that are only required in this application, such as database-driven jar files.
/WEB-INF/src/
  source directory, place each java file according to the package name structure.
/WEB-INF/database.properties
  database configuration file
/WEB-INF/tags/
The custom tag file is stored. This directory is not necessarily tags. You can name your own tag file library according to your own preferences and habits. When using a custom tag file library name, you must declare it correctly when using the tag file. The path to the label file library. For example: when the name of the custom tag file library is simpleTags, when using the tag file in the simpleTags directory, it must be declared in the jsp file header as: <%@ taglibprefix="tags" tagdir="/WEB-INF /simpleTags" %>.
/WEB-INF/jsp/
The file storage location for versions below jsp 1.2. There is no specific declaration for changing the directory. Similarly, you can name it according to your own preferences and habits. This directory mainly stores files of versions below jsp 1.2. In order to distinguish jsp 2.0 files, it is usually named with jsp. Of course, you can also name it jspOldEdition.
/WEB-INF/jsp2/
Compared with the jsp file directory, this directory mainly stores files of versions below Jsp 2.0. Of course, it can also be named arbitrarily. It is also named jsp2 to distinguish the file directory of versions below Jsp 1.2.
META-INF
Equivalent to an information package, the files and directories in the directory are recognized and interpreted by the Java 2 platform, used to configure applications, extensions, class loaders and services
  manifest.mf files are automatically generated when packaged with jar.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326424141&siteId=291194637