`
63528605
  • 浏览: 6438 次
  • 性别: Icon_minigender_1
  • 来自: asf
最近访客 更多访客>>
社区版块
存档分类
最新评论

【转】Apache Tomcat Eclipse Integration

 
阅读更多

转自:http://www.mulesoft.com/tomcat-eclipse

 

Apache Tomcat Eclipse Integration

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 into your Eclipse environment, you're losing out on some great enhancements to your development process.

Imagine being able to write a new servlet, deploy it to a Tomcat server, test it, make changes, redeploy, and restart Tomcat - all within Eclipse, all without editing a single XML file by hand.  Time-saver?  Sanity-preserver?   All of the above?  You bet.  Here's an easy guide to getting Tomcat and Eclipse working together, from installing the Tomcat plug-in, to configuring your first server.

In the interest of simplicity, this tutorial assumes that 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 EMF Model) components

If you need more information on installing these items, visit the Eclipse and Apache Tomcat documentation pages. And to make your Apache Tomcat environment enterprise ready, learn more about Tcat, the leading enterprise Apache Tomcat application server.

Step One - Installing the Eclipse Web Tools Platform

Eclipse uses a set of components 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 in this tutorial.

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

 Tomcat Eclipse Plugin

Click the "Work with:" drop down menu, and select the WTP Project site from the list:

Tomcat Eclipse WTP Plugin

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

Tomcat Eclipse WTP SDK Plugin

Click "Next".  Eclipse will fetch a list of components to be installed, and present them to you.  You can review them if you 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 screen, indicating that you accept the licensing terms for the components that you are about to install (you only need to do this once), and the "Finish" button will become active.

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

Downloading Tomcat Eclipse Components

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

At the end of the install process, Eclipse will give you the option to either restart, or apply the changes without restarting.  Be safe - restart.  It'll only 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 that 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 will present you with this dialogue window:

This dialogue should be familiar to you if you have used Eclipse before.  What we're concerned with is the "Target runtime" box.  Click "New..." to pull up 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 will ask you to locate your installation of Tomcat:

Click "Finish", configure any additional options you like on the New Dynamic Web Project dialogue screen, click "Finish" one more time, and you're done.  Congratulations - you've created your first Tomcat-integrated Eclipse project.

Configuring a Tomcat Server In Eclipse

Now that 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 screen, choose a local name for your new server, as well as a Server name, and click Finish.  If you did everything correctly, a new Server will appear in the Server list.  Double-clicking on the server's name will 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 that you've configured a Tomcat Server for use in your Eclipse project, you can deploy whatever test application you choose to build on the server simply by starting the Server, right-clicking the application in the Project Explorer pane, and choosing Run On Server from the "Run As..." menu option:

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

分享到:
评论

相关推荐

    eclipse-tomcat-插件

    找到相应的插件(如“Apache Tomcat Integration”或“JST Server Adapters”)后,按照提示进行安装。安装完成后,需要重启Eclipse使插件生效。 安装完毕后,Eclipse会新增对Tomcat服务器的支持。在“窗口”菜单中...

    eclipse插件 -tomcat插件

    1. 使用Eclipse的内置市场(Eclipse Marketplace):在Eclipse中打开Marketplace,搜索“Tomcat”或“Server”,找到相应的插件(如“Apache Tomcat Integration for Eclipse”),然后按照提示进行安装。...

    eclipse-Mars2-4.5.2安装Tomcat8插件

    在列表中找到与Tomcat相关的插件,例如 "Tomcat Integration for Eclipse" 或 "Tomcat v8.0 Server Adapter"。选中这些插件,然后点击"下一步"(Next)。 步骤五:确认插件详情 在下一个页面,你可以查看即将安装的...

    eclipse的tomcat插件

    找到合适的插件,如“Apache Tomcat Integration for Eclipse”,点击“Install”按钮按照提示进行安装。 3. **手动安装** 如果使用的是压缩包,将解压后的插件文件(通常是`.jar`格式)复制到Eclipse的`plugins`...

    maven tomcat eclipse

    Eclipse拥有丰富的插件系统,可以支持多种编程语言和框架,包括Java EE,因此可以通过安装相关的插件,如M2E(Maven Integration for Eclipse)和Tomcat插件,实现对Maven和Tomcat的集成,方便开发者在Eclipse中直接...

    Eclipse的tomcat插件

    在Marketplace中搜索“Tomcat”即可找到相关的插件,如“Apache Tomcat Integration”或“Tomcat Plugin”。下载文件后,通过Eclipse的“Install New Software”功能进行安装,选择本地的插件文件路径。 安装完成后...

    tomcat6在eclipse下的插件

    3. **Eclipse的Tomcat插件**:Eclipse有多种插件可以与Tomcat集成,例如“Tomcat Integration for Eclipse”(TIDE)或"Apache Tomcat Server Adapter"。这些插件提供了在Eclipse内管理Tomcat的功能,包括启动、停止、...

    eclipse用tomcat插件

    在"Help"菜单中选择"Eclipse Marketplace",然后在搜索框内输入"Tomcat",找到相关的插件如"Tomcat Integration for Eclipse"或"JST Server Adapters",按照提示进行安装并重启Eclipse即可。 一旦插件安装成功,接...

    eclipse plugin tomcat

    1. **Eclipse Marketplace**:打开Eclipse,进入“帮助”(Help)菜单,选择“Eclipse Marketplace”,在搜索框中输入“Tomcat”或“Tomcat Plugin”,找到相关的插件如“Apache Tomcat Integration”或“JST Server...

    Eclipse与Tomcat

    ### Eclipse与Tomcat知识点概述 #### 一、Eclipse简介 **Eclipse** 是一个开源的集成开发环境(IDE),最初由IBM开发,后来成为独立的项目,支持多种编程语言和开发工具。Eclipse 最初是为了替代 IBM Visual Age ...

    eclipse4.4 +mavne3.3.9 + tomcat7.0

    在Eclipse中,可以通过"Window" -> "Preferences" -> "Server" -> "Runtime Environments",点击"Add"按钮,选择Apache Tomcat 7.0,并关联到你的Tomcat安装目录。 四、创建Maven项目 在Eclipse中,选择"File" -> ...

    Eclipse tomcat插件

    Eclipse是一个广泛使用的开源集成开发环境(IDE),而Tomcat则是一款流行的Java Servlet和JavaServer Pages(JSP)容器,是Apache软件基金会的Jakarta项目的一部分。Eclipse Tomcat插件使得开发者能够在Eclipse环境...

    maven-eclipse-tomcat热部署

    在Eclipse中,首先需要安装Maven Integration for Eclipse插件,然后导入刚刚创建的项目。确保项目设置正确,包括Maven构建路径和JRE版本。 3. **Tomcat 集成与配置** 在Eclipse中,通过Servers视图添加一个新的...

    Eclipse+tomcat+maven 配置Spring mvc图文教程.zip

    为了在Eclipse中搭建Spring MVC项目,你需要安装几个必要的插件,如M2E(Maven Integration for Eclipse)用于支持Maven项目,以及Spring Tools Suite(STS)提供对Spring框架的专门支持。 接着,Maven是Apache组织...

    Tomcat 插件

    4. Eclipse/Tomcat Integration:Eclipse也有类似的插件,如WTP(Web Tools Platform),能够方便地在Eclipse中管理和调试Tomcat应用。 5. Maven Tomcat Plugin:使用Maven构建项目的开发者可以通过Maven插件直接将...

    idea部署eclipse的web项目(tomcat)

    本篇将详细介绍如何在Idea中部署一个原本在Eclipse中开发的Web项目,使用的服务器是Apache Tomcat。 首先,理解Java Web项目的基本结构至关重要。一个标准的Java Web项目通常包含以下几个关键部分:`WEB-INF`目录、...

    Eclipse SVN Jetty Tomcat jad 等常用插件

    Eclipse中的Jetty插件(如“Jetty Integration for Eclipse”)可提供集成的开发环境,使得在Eclipse内部就可以调试和测试基于Jetty的Web应用。 3. **Tomcat**: - Tomcat是Apache软件基金会的项目,也是一个流行...

    tomcatPlugin

    此外,由于该插件是针对Eclipse 3.2设计的,对于更高级别的Eclipse版本,可能需要寻找兼容性更新或者使用专门为新版本Eclipse开发的其他插件,如“Apache Tomcat Integration for Eclipse”或“JST Server Adapters...

Global site tag (gtag.js) - Google Analytics