Web module, the Web application in the Servlet specification. In the Java EE schema, Web modules (Web module) are the smallest Web deployment unit. It contains Web components and static resources; Static resources, such as pictures, are also called Web Resources .
In addition to Web Components and Web resources, Web modules can contain other files, such as the tool classes needed to run the server, JAR packs, and so on.
The Web module has a specific structure. The top-level directory corresponds to the Web application's document root. can store HTML pages, static Web resources, and so on.
The root directory contains a Web-inf folder that can contain the following files and directories: The classes directory, the server-side related class: such as servlet, bean, tool class, and run-time resources such as XML, configuration files, and so on. Lib directory, which holds deployment instructions such as various JAR file Web.xml (deployment descriptors)
When using JavaServer face technology, if you need to specify specific security information or overwrite the annotation configuration on the Web component, you need to specify it by Web.xml file.
Depending on your needs, you can add folders or package under the root directory and web-inf/classes/.
The Web module can be unzipped as a folder or deployed as a single war package (Web Archive), essentially a war package that is a zip-formatted jar file. Because the contents of war are different from regular jars, use the. War suffix to differentiate. The Web module is portable (portable); Can be deployed in a variety of web containers that conform to the Java servlet specification.
Web module structure. The root directory contains Web-inf and WEB pages/directories. Web-inf contains the LIB and classes directories below.
└──index.jsp
└──web-inf
└──web.xml
└──lib
└──xxx-1.0.jar
└──classes /xxxservlet.class
└──xxx.properties
Original link: https://docs.oracle.com/javaee/7/tutorial/packaging003.htm
Translation Date: January 21, 2018
Translator: Anchor Http://blog.csdn.net/renfufei