Eclipse Tomcat plug-in configuration and Tomcat configuration (who will teach me ?)

Source: Internet
Author: User

First, download the tomcat plug-in version of the corresponding eclipse version. (Note: The Tomcat plug-in is the Tomcat plug-in and Tomcat is the Tomcat plug-in. The two cannot be confused !)

: Http://www.eclipsetotale.com/tomcatPlugin.html

Decompress the compressed package and put it in the eclipse plugins directory to restart eclipse. The Tomcat plug-in is successfully installed!

Of course, if the installation is successful, it means you can use it. You must configure Tomcat to use the Tomcat plug-in normally,

Configuration process:

First, download the Tomcat version available for Eclipse,

: Http://tomcat.apache.org/

Decompress the package to the specified directory and configure

Eclipse-toolsbar-> Window-> Prefences-> Tomcat-> point to the directory decompressed by Tomcat just now,

After the configuration is complete, you can use the Tomcat plug-in to start and close Tomcat.

Use Eclipse to create a Dynamic Web Project, such as HelloProject

Right-click Run As-> Run On Server->

Dialog Box:

After the configuration is complete, a directory of Servers is displayed under the project directory, which is the Tomcat configuration of the dedicated HelloProject project,

You will also see Servers in the console.

You can use Tomcat, Start, Stop, Restart, and so on.

The important point is:

For the server. xml and Tomcat/conf/server. xml files in the red circle,

We have said that server. xml in the red circle is the configuration file generated for HelloProject. Of course, multiple projects can share the configuration under the same Servers directory! I will not talk about this for the time being.

However, Tomcat/conf/server. xml is owned by Tomcat itself and is more universal.

To facilitate the differentiation, we call server. xml in the Red Circle project. server. xml and Tomcat/conf/server. xml tomcat. server. xml.

This article focuses on the <Context... />

Let's look at the project. server. <Context docBase = "HelloProject" path = "/HelloProject" reloadable = "true" source = "org. eclipse. jst. jee. server: HelloProject "/>

DocBase refers to the HelloProject directory that is equal to the Servers directory, that is, the project directory,

 

Path indicates the Website access path, such as http: // locahost: 8080/HelloProject.

The project. server. xml generated like this is not required.

For <Content... />

The two configurations are correct:

<! -- <Context path = "/HP" reloadable = "true" docBase = "C: \ Documents and Settings \ Administrator \ workspace \ HelloProject \ WebContent" workDir = "D: \ worDir "/> -->
<Context path = "/HelloProject" reloadable = "true" docBase = "C: \ Documents and Settings \ Administrator \ workspace \ HelloProject" workDir = "C: \ workDir"/>

<Context path = "/HPT" reloadable = "true" docBase = "C: \ Documents and Settings \ Administrator \ workspace \ HelloProject" workDir = "C: \ workDir"/>

The website access path is

Http: // localhost: 8080/HP

Http: // localhost: 8080/HelloProject

We can access the above HPT as follows:

Http: // localhost: 8080/HPT/WebContent

In this way, we can see that if docBase refers to WebContent, you can use your own defined path,

If docBase indicates the project directory, you must use the original path of the project or modify the path.

The final workDir is the directory released by jsp after deployment. You can specify it by yourself or not.

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.