Three ways to configure Web servers in MyEclipse

Source: Internet
Author: User
Tags server port

Beginners Javaweb development of people will encounter a problem, is the server environment configuration problems. Here are three ways to build a server.

Direct modification server.xml File

When you write a Web application (Jsp/servlet) and want to access this page directly through a browser, you need to configure the relevant path in Tomcat:

Locate the Tomcat under Conf directory and you will see a server.xml, the server configuration file. Open with a text compiler, pull to the Host tab, and add our application path before it ends:

<path= "/helloweb"  docBase= "E:\MyEclipseWorkspace\HelloWeb\ WebRoot "  reloadable=" true "/>

The Path property value is required to access the page, the first pathname after the server port number, where the/plus project name is used.

The path in the address accessed in the browser is consistent with the path configured here (see the path name after port number 8080 below).

docBase The Webroot path of the property value item.

You can see the results by entering the following address directly in the browser. (Of course you have to start the Tomcat server first)

http://localhost:8080/HelloWeb/index.jsp
Running Tomcat in MyEclipse

Before running Tomcat server, we need to run Tomcat. The author is the bin path under the Tomcat7.exe.

we can also put Tomcat's boot in the MyEclipse IDE , which is more convenient and useful for debugging in MyEclipse.

First we need to configure MyEclipse to integrate Tomcat into the development environment:

Select Servers in the window->preferences:

Then search the server, locate the runtime environment under Server, then add on the right-hand side, select the version, and then find the installation path for Tomcat. The author uses MyEclipse CI, which has the integration of other versions of Tomcat, the second one is that it comes with.

You can start the Tomcat server in the IDE by configuring it:

You can easily turn the server on and off by using the button on the right of the deployment button on the toolbar (which turns into a kitten after the point):

The button you deploy is the button in the diagram, and after deployment is complete, you can discover the project folder in the Me-webapps folder under the Tomcat path.

Its name is the project name, and its content is essentially the Webroot directory of the original project. And the name of this folder is the path name of the context.

However, this type of deployment is less efficient, and changes made by the IDE are sometimes automatically overwritten, sometimes not automatically overwritten, and can only be redeployed.

And this way relies on the IDE.

So it is not recommended to use this method. It is also recommended to use the first method, once deployed, without any further control.

Copy path

The third way to deploy is to manually copy the Webroot path to the past, then rename it, and its name as the context path. is also considered a kind of deployment.

Three ways to configure Web servers in MyEclipse

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.