设为首页 收藏本站
查看: 726|回复: 0

[经验分享] 【转】Apache Tomcat Eclipse Integration

[复制链接]

尚未签到

发表于 2017-1-2 08:21:00 | 显示全部楼层 |阅读模式
转自: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:

  Click the "Work with:" drop down 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 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:

  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.      

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-322601-1-1.html 上篇帖子: Apache DBUtils入门(一) 下篇帖子: Apache common deamon的使用
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表