Two ways to deploy Tomcat in MyEclipse

Source: Internet
Author: User

I. Deployment in MyEclipse software

1, in MyEclipse, after the creation of the project, in the MyEclipse menu bar, select Windows-Preferences-MyEclipse, TOMCAT5, select "Enable"; Tomact Home Directory to select the directories that Tomcat installs on your machine. Then, Tomcat5->jdk, MyEclipse, Preferences, Windows, and so on, make sure that there is a corresponding JDK version, and if not, add its installation path via "add". Ok

2. Select the button on the toolbar, select the project you want to deploy in project, then "Add" and select "Tomcat", Finish.

3. Select on the toolbar to start Tomcat.

4, run the program. Enter http://localhost:8080/aa/WebRoot/index.jsp (AA is the project name) in IE

Ii. deployment in Tomcat's server.xml configuration file

1. Under Tomcat, locate the Server.xml under the Conf file and open it.

2. Add the following code between <Host> and

1
2 <context path= "/virtual directory Name" docbase= "Destination directory location" debug= "0" reloadable= "true" >
3 </Context>

(Strictly case-sensitive, when path= "", this time the virtual directory is directly rooted--->http://localhost:8080/)
Parameters:

Path: Indicates that the http://localhost:8080/virtual directory name is entered in the browser

DocBase: Represents the physical absolute path of your package, the default absolute path is%tomcat_home%/webapps

Reloadable: True, Tomcat automatically detects changes in the application's/web-inf/lib and/web-inf/classes directories, automatically loads new applications, and we can change the application without having to restart Tomcat ; False to not load automatically.

(I think this deployment method is good here, so you don't have to restart Tomcat.) It is not known where the previous method is configured to achieve the same effect. If there is, please expert guidance! )

Example:

1
2 1 <!--My Custom directory--
3 2 <context path= "/wess" debug= "0" docbase= "C:\Documents and Settings\tt\workspace\welcome_ss\webroot" reloadable= "True" >
4 3 </Context>
5 4

3. Start Tomcat

On the MyEclipse toolbar, select to start Tomcat. Or under Tomcat, locate the Startup.bat under the bin file and open it for startup.

4, run the program. Enter http://localhost/wess/index.jsp in IE address (when referencing the example configuration above)

Report:

In the Lib Struts-config.xml can add the following three sentences to the default configuration of the home page, that is, in IE, just enter the home page in the directory, rather than write the page. As the above configuration, you can enter only http://localhost/wess

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

Two ways to deploy Tomcat 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.