How common Java projects in eclipse are deployed to Tomcat

Source: Internet
Author: User

The way I do it now:

1. When configuring Tomcat in Eclipse, choose Create context file instead of Server.xml, the benefit is that the file can be arbitrarily named, consistent with the virtual directory (that is, the attribute path in XML). When Tomcat loads a project, it scans all the XML files in the Conf\catalina\localhost directory and then loads them according to the configuration.

The XML file in the Conf\catalina\localhost directory. In general, a project corresponds to an XML file, and if you want to load only one project, change the file to non-XML.

The contents of the XML in the context file:

<context privileged= "true" antiresourcelocking= "false" Path= "/myapp" reloadable= "true" docbase= "D:\ECP_workspace \myapp\applications "  />

  

2. Transfer the classes folder from the build folder to the Web-inf. On the project, right-click Build path--〉configure Build Path, set the default output folder. At the same time, the Lib is also placed under the Web-inf, tomcat loading can be loaded together.

The corresponding project directory structure, as follows:

Reference:

Three ways to deploy projects in Java Web development tomcat

How to quickly develop an SSH framework project

How common Java projects in eclipse are deployed 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.