Java Web basics: Fourth, the document structure of Java Web Applications

Source: Internet
Author: User

 

Document structure of Web ApplicationsWeb applications contain a large number of files, including JSP files, HTML files, image files, java files, configuration files, and other class libraries. These files must be organized according to a certain structure. Each web application has a root directory. Generally, this root directory is the name of the application. Assume that this root directory is bookstore. You can directly store JSP files, HTML files, image files, and other interface-related files in the root directory. However, to facilitate management, files are usually classified. Generally, web applications are divided into several modules, and files related to each module are put in a directory. Assume that Web applications include user management, book management, and order management, you can create sub-directories of usermanagement, bookmanagement, and ordermanagement under bookstore. Then, put the files related to each module in this directory. A large number of images may exist in Web applications. To facilitate management, a subdirectory is usually created in bookstore to save all the images. This subdirectory can be named images. Some public files may be used in various modules of the Web application, such as the navigation bar of the page, copyright information, and error pages. You can create common subdirectories to store these shared files. In addition, there is a special subdirectory WEB-INF in the Web application, other subdirectories can not use this name, the files placed in this directory can not be accessed through the browser, files in this directory are mainly used by the server. Under the WEB-INF directory, there are two subdirectories and a configuration file web. xml. The two subdirectories are classes and Lib. The former is used to store all website-related java files, and the latter is used to store java files in the form of a compressed package. jar. Web. XML is mandatory for every web application and is the configuration file of the Web application. To sum up, the document structure of a Web application is roughly as follows: inventory + bookstore project directory + bookmanagement Module 1 + usermanagement module 2 + ordermanagement Module 3 + Images image + common sharing page + WEB-INF storage configuration file + classes storage compiled class file + lib Storage web. xml configuration files for each web application refer to JD K and tomcat are not introduced for installation. If you have any problems, please ask me. Next, we will introduce how to manually create a web application. Last Lecture: Third, Java Web application OverviewNext Lecture: Fifth, manually build Web ApplicationsLi xucheng csdn blog: Why? U= 124362 & C = 7be8ba2b6f3b6cc5
Related Article

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.