Detailed graphic tutorial to implement how to configure tomcat in the eclipse environment, and deploy the project to the Tomcat server, eclipsetomcat

Source: Internet
Author: User

Detailed graphic tutorial to implement how to configure tomcat in the eclipse environment, and deploy the project to the Tomcat server, eclipsetomcat

Many beginners, especially those who learn JavaWeb, will always have a hard time getting started when they configure tomcat in eclipse for the first time. Here, through graphic illustration, this configuration process is the most intuitive demonstration.

 

Part 1: how to configure tomcat in eclipse

1. Download and install Eclipse and Tomcat

2. Open Eclipse, click the "window" menu, and select "Preferences" below ".

 

3. Click Add to Add Tomcat.

 

4. Select the tomcat path you have installed.

 

 

5. Select the jdk version.

 

6. Select Your jdk version.

 

 

7. Click add.

 

 

8. Select the jdk installation path.

 

9. The selection is complete. Add automatically and click "finish.

 

 

10. Select the jre we just installed.

 

11. Complete.

 

 

Part 2: deploy the project to the Tomcat server

 

1. Create a project. Open eclipse. In the menu bar, open File -- New -- Other..., find the web -- Dynamic Web Project, and click Next.

 

 

 

Project name:TomcatTest

Target runtime:Click "New Runtime" on the right and select your own server. Here, we select Apache -- Apache Tomcat v7.0. After selecting the server, click "Next". A message is displayed: Tomcat installation directory :, find the Tomcat7 location you have extracted. Click "Finish ".

Configuration:Click "Modify" on the right side to perform proper configuration. However, based on my beginner's experience, you can simply use the default one. Do not change the content. When you use the configurations, you are an old bird.

 

 

 

2. Notes.

* You can change the directory name if the directory is the same as that in myeclipse.

* To generate an xml file, you can check the options. (It is best to hook it up)

 

 

3. The effect is as follows:

 

 

4. display the Tomcat server on the console.

 

 

 

 

5. Select the Tomcat version.

 

6. Add our project.

 

 

7. Click add or double-click to add to the right.

 

 

8. Click bugs to start.

 

9. Enable access directly: http: // localhost: 8080/TomcatTest/

A 404 error is reported.

 

** Because we did not add a home page. The content added below.

 

 

The source code is as follows:

 

<% @ Page language = "java" contentType = "text/html; charset = UTF-8" pageEncoding = "UTF-8" %> <! DOCTYPE html PUBLIC "-// W3C // dtd html 4.01 Transitional // EN" "http://www.w3.org/TR/html4/loose.dtd"> 

 

 

Visit this link again: http: // localhost: 8080/TomcatTest/

 

The effect is as follows:

 

 

Complete. The layout may be messy, but I hope it will help you.

 

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.