Configuring Tomcat in Eclipse

Source: Internet
Author: User
Tags tomcat server apache tomcat

configuring Tomcat in Eclipse

2012-06-05 10:28:17| Category: MyEclipse | Report | Font size Subscription

1. Installation of Eclipse. This is downloaded from the Eclipse's official website. Do not teach, download the post EXE file to perform the installation. My version is,
Eclipse SDK
version:3.4.2
Build id:m20090211-1700

2, download a tomcat, from the official website of Apache downloaded one, I next is, 6.x version, file name: Apache-tomcat-6.0.35.zip
Address http://tomcat.apache.org/download-60.cgi, download the version of Windows, download and then unzip to use.
Launch Tomcat, browser input, HTTP://%tomcat_home%/bin/startup.bat (%tomcat_home% for Tomcat's installation directory, which is the previous unzip directory) after installation localhost:8080/, if the Apache Tomcat page appears, the Tomcat installation is normal.

3. Download the Tomcat plugin for Eclipse.
: http://www.eclipsetotale.com/tomcatPlugin.html
This page also, installation instructions, English good can see for themselves.
I'm under this: Tomcatpluginv32.zip.

The following is a specific tomcat configuration:

Configuration of the Tomcat plugin:

1, unzip Tomcatpluginv32.zip, default to TomcatPluginV32, and then copy com.sysdeo.eclipse.tomcat_3.2.0 this folder to install Eclipse under the \plugins folder. You can now see multiple tomcat in the menu bar, and a Tomcat icon appears. If not, remove the entire eclipse first, then reinstall Eclipse, then repeat the steps to unzip the Tomcatpluginv32.zip and try again, then you can open eclipse.
2. Configure Tomcat. Select Window > Preferences, Open the Preferences dialog, select "Tomcat" from the menu on the left, and select the version of Tomcat in the radio button above. Note that you have Tomcat files and so on. I used the Tomcat version number apache-tomcat-6.0.29, so I chose the last radio button "version 6.x". The TOMCAT Home variable must then be set. Click the "Browse" button at the edge of the "Tomcat Home" dialog to browse to the root of the version of Tomcat that you just unpacked (for example, D:\Tomcat 4.1, which is the folder containing the bin), and then click the "OK" button. The configuration file is automatically selected and the appropriate content is added to the dialog box. If you want to select a different configuration file for Tomcat, you can now browse these files. Otherwise, the default value is used normally. ((We've now implemented the minimum requirement to start and run Tomcat using the Eclipse and Sysdeo Tomcat Launcher plug-in.) Browse the following additional parameter settings for Tomcat in the Eclipse Preference dialog box, and note that there are many other options available in Tomcat's parameter settings. For example, you can add a parameter to the JVM used by the Tomcat server, choose a Java project from the workspace to add to Tomcat's classpath, and make some settings to allow the Tomcat to manage the application)
3. Test Tomcat and Eclipse. To test the integration of Tomcat and Eclipse, you can start by creating a new project. Select File > New > Project and Check the wizard content for the new project. In the Java section of this project Wizard, there is a new item, "Tomcat Project." Select this option, and then click Next. Take a name for this new Tomcat project. For example "Tomcattest", shown in 7. Click Next. Now that we have seen that you can specify a name for the Context of a Web project, you can also specify a subdirectory as the root directory for the Web application. Now we leave the default value unchanged, click Finish.
4. Create a JSP file to test

The easiest way to test the installation process is to create a new file in the root folder of the WAR project. Create a new file, called "index.jsp" here. To do this, select your project in the workspace (such as the tomcattest you just created), and then right-click on it. Select New > File, name it "index.jsp", then click Finish.
Add the contents of Listing 1 to the index.jsp file and save the file.

Listing 1. index.jsp File Sample

<body>
<%java.util.date d = new Java.util.Date ();%>

Todays date is <%= d.getdate ()%> and It OK now!!
</body>
5. Use the Sysdeo plugin to start Tomcat

To start the Tomcat server, simply click the Start Tomcat button in the toolbar. You can also select the Tomcat menu from the main menu and then select Start Tomcat. The TOMCAT server will now start and the text at startup will appear in the Console view of the Eclipse Workbench.
6. Launch the browser and view the index.jsp file
After the server has started, start a Web browser. Go to URL http://localhost:8080/TomcatTest/index.jsp.
A page is mounted and you should see a message similar to the following:
Todays date is and It OK now!

Configuring Tomcat in Eclipse

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.