Create a simple Web project with Eclipse

Source: Internet
Author: User

Eclipse Neon Chinese version;

1. Right click New--Select Dynamic Web Project

2: Fill in the project name Project location; Select Dynamic Web Module version and Tomcat version; Click Finish to create the project;

2.1: Project name;

2.2: Project location;

There is a matching relationship between 2.3:dynamic Web Module version and Tomacat version: matching relationships such as

3: Create the project structure after successful:

4: Look at the properties of the project after creating the project structure:

4.1: View the path to the project (here is what path is the path?).  Guess.); The location of the project (where is the position? guess); Project code: UTF-8;

4.2 View project Facets: (Found in the red box in the version of it? Guess what they have to do with what?)

4.3 Project deployment: Web Deployment Assembly (Web Deployment integration) This is primarily the configuration of the Web deployment directory;  (What does this deployment directory affect?) Guess!)

4.4 Java Compiler: This will cause your project to compile if it is inconsistent with the JDK version you set.

4.5 Java Build Path: (Guess what the build path means?) guess what it's going to affect? If you can not guess, click on the arrows to indicate the Add folder, open the directory structure after opening, I believe you will understand);

This is the 4th step that needs to know what the above properties mean. This will make it easier to understand the entire project structure, and if you have 404 and so on after startup, your answer may be in one of these configurations;

5: Create a new page under the WebContent directory index.jsp (that is, with Web-info is the same directory level) (note: The location must be in the WebContent directory to guess why?)

Index.jsp the name can be casually up;

Enter HelloWorld inside the index.jsp!

The directory structure at this time:

6: Deploy the Web project to run:

6.1 Select Server my is Tomcat 9

7 Click Finish to run:

At this point the console information: Indicates that Tomcat has started to complete.

8: Browser address bar input address: localhost:8080/web02/(note: The address here only to the project address, no write page address, also can access, guess why?) if you add a welcome.jsp page, you can also directly enter the project address Did you ask index.jsp? You can try it yourself. And then guess why?

Hello world has been shown on the page!

Congratulations on successfully creating a simple Web page.

Create a simple Web project with Eclipse

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.