Use Eclipse to publish a Web project and deploy it on the Tomcat server, and use javassetomcat

Source: Internet
Author: User

Use Eclipse to publish a Web project and deploy it on the Tomcat server, and use javassetomcat

Use Eclipse to publish a Web project and deploy it on the Tomcat server:

1. Create two Java Web projects: JavaWeb_TestRelease01 JavaWeb_TestRelease02, and create two index. jsp pages in the project. The body content is:

Wecome to aaa.com home page, Wecome to bbb.com home page

2. Use Eclipse to Export the two projects as. war files, select the projects respectively, right-click, and select Export...> select Web WAR file> select Export address> Finish

3. Start Tomcat after installation. Open the browser and enter http: // localhost: 8080/To Go To The Apacge Tomcat homepage. Click the Manager App on the right to enter the username and password.

4. Click WAR file to deploy to upload the project. war file you just used to package and export using elasticsearch.

5. Check after uploading: there are two more items in the list: click the link on the left to access: normal access is found.

However, the website is usually accessed directly through the domain name binding port. You need to point to the folder to access it normally. We open the Tomcat installation address and install it on: c: \ Program Files \ Apache Software Foundation \ Tomcat 9.0. the following Files are displayed in webapps:

Open the server. xml file in conf:

View server. xml node (note that the comments mentioned here have been deleted by me): the following mark indicates that the domain name is bound to the localhost. The access port corresponding to the localhost is 8080, And the folder address pointed to is webapps, therefore, you can enter http: // localhost: 8080/JavaWeb_TestRelease01/and http: // localhost: 8080/JavaWeb_TestRelease02/in the browser to access the service normally.

At the end of the next section, configure server. xml to directly access the publishing website through the domain name port, without the project file name/JavaWeb_TestRelease01

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.