Configure Tomcat in Eclipse and deploy the project to Tomcat

Source: Internet
Author: User
Tags tomcat server

Reference: http://blog.csdn.net/yerenyuan_pku/article/details/51830104

First click on window and then preferences

Then click Add to select the version of Tomcat

Choose a good tomcat path and JRE

Then create a Dynamic Web Project

That context root can be said to be the name of the contexts that content directory is the name of the folder where the Web files are placed

Now we can say that we've got Tomcat in eclipse, and then we're going to deploy the Web app to Tomcat.

Let the tomcat server appear on the console first:

Window->showview->servers

Click on that line for no servers, then follow the prompts to add the dynamic project we just built. Then try to run and test with http://localhost:8080/.

And then you'll report 404 errors.

This is because, we double-click this server, we will find that the location of the server is workplace default, that is, our normal working space. This means that there is no such project under Tomcat WebApp, and we know that the Web project should be placed under Tomcat's WebApp to run successfully. So we have to change it now, but we can't change it.

Now all we have to do is remove all the projects that are deployed under the server (that is, the project under the WebApps of the Tomcat installation path)

, and then right-click on the server, select Clean,clean, and then double-click the server to enter the configuration to discover that the configuration can be modified.

Then just 1. Change location to Tomcat 2. Change the deploy path to WebApps and save!

And then test it again and get it done!

Configure Tomcat in Eclipse and deploy the project to Tomcat

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.