How to configure Tomcat in the Eclipse environment

Source: Internet
Author: User
Tags tomcat server apache tomcat

How to configure Tomcat in the Eclipse environment

Many beginners, especially self-taught javaweb friends for the first time in the configuration of Tomcat, there is always a difficult to start the feeling, in this, through the method of graphic interpretation, the most intuitive to show you the configuration process.

Part I: How to configure Tomcat in the Eclipse environment

1. Download and install Eclipse and Tomcat successfully

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

3. Tap add to add Tomcat.

4. Select the Tomcat path that you installed.

5. Select the JDK version.

6. Select your own JDK version.

7. Click Add.

8. Select the JDK installation path.

9. Select Done. Add it automatically, then click the Finish button.

10. Select the JRE that we just installed.

11. Complete.

Part II: Deploying the Project to the Tomcat server

1. Create a new project. Open Eclipse, under the menu bar, File--new--other ..., open and locate Web--dynamic Web Project, and then click Next.

Project Name: Tomcattest

Target Runtime: Click on the right "New runtime", select your own server, here we choose: Apache-Apache Tomcat v7.0, select, click "Next", there is an entry: Tomcat Installation directory: Locate the location where you unzipped the TOMCAT7. Then click "Finish".

Configuration : Click on the right "Modify", can be properly configured, but according to my beginner experience, completely use the default on the line, do not move the inside of things. When used in the configuration, you are already a veteran.

2. Precautions.

* If you need the same directory as the MyEclipse, you can change the name of the directory.

* If you want to generate an XML file, you can tick the option. (preferably on the hook)

3. The effect is as follows:

4. Have the Tomcat server appear on the console.

5. Select the Tomcat version.

6. Add our project.

7. Select click Add, or double-click to add to the right.

8. Click Bug to start.

9. Direct Start Access: http://localhost:8080/TomcatTest/

Will find that it will report a 404 error.

* * Because we didn't add the homepage. Add the following content.

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" >

Once again to access the link: http://localhost:8080/TomcatTest/

The effect is as follows:

Complete. May be a bit messy typesetting, but hope to help everyone.

How to configure Tomcat in the Eclipse environment

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.