The simplest structure of a Java Web project

Source: Internet
Author: User
Tags java web

Build a simple process for creating a web App for "Bare Hands"

1, in any directory, create a folder, take the name Webdemo. This applies the name.

2. Create a Web-inf folder within Webdemo, which is case sensitive.

3. In the Tomcat Project example (there is an example in Tomcat's WebApps directory), copy a Web. xml file. Put it in the Web-inf folder.

4. Modify the copied Web. xml file to modify the file to a single root directory. The modified Web. XML looks like this:

<?XML version= "1.0" encoding= "Iso-8859-1"?><Web-appxmlns= "Http://java.sun.com/xml/ns/javaee"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"xsi:schemalocation= "Http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"version= "3.0"Metadata-complete= "true">   </Web-app>

5, under the Web-inf folder Xinjiang two folders classes and Lib. These two folders are basically the same, all of which are placed in JAVA class files. The difference is that classes put all the *.class files, and Lib contains the packaged jar files.

6, after the above steps, has already established the empty Java Web application. Copy the Webdemo to the Tomcat WebApps directory. You can access this app by opening Tomcat.

7, in order to see the effect, in the application and directory (Webdemo), the creation of JSP files. You can access it. For example, establish a.jsp. The Access path is:

http://localhost:8888/webDemo/A.jsp

The simplest structure of a Java Web project

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.