Explain how to create a simple web project with eclipse (Graphic)

Eclipse neon Chinese version;

1; Right click New -- > and select dynamic web project

2: Fill in the project name and location; Select dynamic web module version and Tomcat version; Click Finish to create the project;

2.1: project name;

2.2: project location;

2.3: there is a version matching relationship between dynamic web module version and tomacat version: the matching relationship is shown in the figure below

3: Project structure after successful creation:

4: After creating the project structure, first check the properties of the project:

4.1: view the path of the project (here is the path. What path is it? Guess.); Project location, (what is the location here? Guess); Project code: UTF-8;

4.2 check the project structure: (did you find the version in the red box? Guess what they have to do with?)

4.3 project deployment: Web deployment assembly is mainly used to configure the deployment directory of the web; (what will this deployment directory affect? Guess!)

4.4 java compiler: if this is inconsistent with the JDK version you set, your project will fail to compile

4.5 Java build path: (guess what the build path means? Guess what it will affect? If you can't guess, click the add folder indicated by the arrow in the figure below, and click open to open the directory structure. I'm sure you'll understand it);

This is step 4. You need to understand what the above attributes mean In this way, you can better understand the whole project structure, and if there are 404 and other path problems after startup, your answer may be in one of the above configurations;

5: create a new page index. Under the webcontent directory JSP (that is, it is at the same directory level as web info) (Note: the location must be in the webcontent directory. Guess why?)

index. JSP is a name that can be given casually;

In index Enter HelloWorld in JSP!

Directory structure at this time:

6: To deploy and run a web project:

6.1 select the server. My is Tomcat 9

7 click Finish to run:

At this time, the console message: Tomcat has been started

8: Enter the address in the browser address bar: localhost: 8080 / Web02 / (Note: the address here only reaches the project address, and you can access it without writing the page address. Guess why? If you are adding a welcome.jsp page, you can directly enter the project address and access index.jsp? You can try it yourself. Then guess why?)

Hello world is already displayed on the page!

Congratulations on creating a simple web page

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>