Apache Tomcat Eclipse Integration

Source: Internet
Author: User
Tags apache tomcat

An illustrated Quick Start guide

Apache Tomcat makes hosting your applications easy.  The Eclipse IDE makes development easy.  It ' s simple math. If you haven ' t integrated Tomcat in your Eclipse environment, you ' re losing off on some great enhancements to your devel Opment process.

Imagine being able to write a new servlet, deploy it to a TOMCAT server, test it, make changes, redeploy, and restart TOMC  At-all within Eclipse, all without editing a single XML file by hand.  Time-saver?   Sanity-preserver?  All of the above?  You bet. From installing the Tomcat plug-in to configuring Yo getting Tomcat and Eclipse working together ur first server.

In the interest of simplicity, this tutorial assumes so you ' ve already installed:

    • A JDK of version 1.4.2 or higher
    • The Tomcat version of your choice (version 5.5.x or higher is recommended)
    • Eclipse 3.1 or higher, along with the EMF (Eclipse Modeling framework), GEF (graphical Editing framework), and JEM (Java E MF Model) components

If you need more information on installing these items, visit the Eclipse and Apache Tomcat documentation pages. Your Apache Tomcat Environment Enterprise ready, learn more about Tcat, the leading enterprise Apache Tomcat a Pplication server.

Step one-installing the Eclipse Web Tools Platform

Eclipse uses a set of called the Web Tools Platform, or WTP, to integrate application servers into the eclipse  Environment. Although you can download WTP as a ZIP file, it's quite easy-to-install from within Eclipse, and this is the method we ll Use the This tutorial.

To install WTP, select the "Install New software ..." menu item from the Eclipse "Help" menu. This'll call up the dialog pictured below:

Click the ' Work with: ' Drop menu, and select the WTP Project site from the list:

Next, select the latest version of the WTP SDK from the list of projects. In this tutorial, we'll use version 3.x:

Click "Next".  Eclipse would fetch a list of installed, and present them to you.  You can review them if your want, but it's not necessary.  Click "Next" again to reach the page "Review Licenses". Click the radio button in the lower right hand corner of the screens, indicating that I accept the licensing terms for th E. Components, the "Finish" button would become active to install (as you have need to does this once).

Once you click the "Finish" button, Eclipse would begin downloading the components and installing them:

This process would take the some time, so get up and go for a stroll. If you get a dialogues about installing unsigned content, don ' t worry-just click "OK".

At the end of the install process, Eclipse would give you the option to either restart, or apply the changes without Restar  Ting.  Be Safe-restart. It ' ll take a few seconds, and when Eclipse starts up again, you'll be almost ready to start using Tomcat with Eclipse !

Creating Your First tomcat-integrated Eclipse Project

Now so you ' ve installed the WTP, it's time to start using Tomcat with Eclipse.  Start clicking "File-->new" and selecting "Dynamic Web Project" from the list of options. Eclipse would present you and this dialogue window:

This dialogue should is familiar to if you have used Eclipse before.  What are we ' re concerned with is the "Target Runtime" box. Click "New ..." to the following dialogue:

Open the Apache folder, and select the version of Tomcat you ' ve installed on your system.  For this example, we'll be using Tomcat 6.  If you want to create a new local server for your project, check the box below the list of server runtimes. Click "Next", and Eclipse would ask you to locate your installation of Tomcat:

Click "Finish", configure any additional options, and the New Dynamic Web Project Dialogue screen, click "Finish" O  NE more time, and you ' re-done. Congratulations-you ' ve created your first tomcat-integrated Eclipse project.

Configuring a Tomcat Server in Eclipse

Now so you ' ve created a Tomcat-aware project, you still need to define a TOMCAT server for the project to use.  You can do this in the "Server" tab, located in the lower half of Eclipse ' s development screen by default. Secondary Click inside the tab to open the New Server dialogue:

On the next screens, choose a local name for your new server, as well as a server name, and click Finish.  If you do everything correctly, a new server would appear in the server list. Double-clicking on the server ' s name would call up a window in which you can edit basic information about the server:

You can also edit Tomcat's Configuration files within Eclipse by selecting them from the Servers drop-down menu in Project Explorer, located on the left hand side of Eclipse ' s development view:

Running an application on Your Tomcat Server

Now so you ' ve configured a Tomcat Server for use in your Eclipse project, you can deploy whatever test application you c Hoose to build on the server simply by starting the server, right-clicking the application in the Project Explorer pane, a nd choosing run on Server from the "Run as ..." menu option:

That ' s the basics-the rest was up to you! For more information on the using Eclipse with Apache Tomcat, visit the WTP Tomcat FAQ page.

Apache Tomcat Eclipse Integration

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.