To deploy the Web project on eclipse to the Tomcat server experience Summary

Source: Internet
Author: User

1. Add the Tomcat plugin to eclipse

Window---Preferences----Runtime environment-----Apache

Select the same item as the version of Tomcat you downloaded (v6.0, v7.0, v8.0), next select the address of the Tomcat to download, finish,ok!

2, at the console of the Web project, switch to the Servers option, click on the space, right--->new-->server, select the corresponding version of Tomcat Server,finish (not Next), You can then see one more server under the server option, right-click Open or double-clicking Tomcat Server, configured as follows:

There may be a problem where the server location is gray, cannot be selected, this time need to start this server (if the server has a Web project, and the settings are not correct, the server can not start, the Web project remove and then right-click Tomcat Server Clean and restart)

3. Add the Web project to the Tomcat server (right-click Add) and start the Tomcat server. If you are unable to start successfully after the above steps, check if your code is wrong and the configuration file is incorrectly written.

Here's a question of my own.:<url-pattern>servlet/test</url-pattern> is right to write this in eclipse, but always error when booting with the Tomcat server, I added the following in front of the servlet.

<url-pattern>/servlet/Test</url-pattern>

4. At this time, you can see the WebApps folder under the Tomcat installation directory and have more of your own Web projects, and in/config/servlet.xml also more about their own Web project configuration items

Here's the question about starting Tomcat in Eclipse and starting Tomcat directly:

As long as the configuration is correct, both methods are correct, the Java file will be compiled when launched in Eclipse, and the file will not be compiled directly. In fact, the relationship between the two is this: Eclipse just use the Tomcat plug-in to start the Web project, and directly with Tomcat boot is the same, but eclipse when using the Tomcat plugin will do something, such as the class file, Files such as Web. xml files are synced to the Tomcat file directory, so that you can start the project directly by starting Tomcat, and the effect is the same

To deploy the Web project on eclipse to the Tomcat server experience Summary

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.