5.3 Java Web application directory structure __java

Source: Internet
Author: User
Tags java web

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.