Configure Tomcat with Eclipse

0. Introduction

[ Tomcat ] : Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies. (http://tomcat.apache.org/)

[ Eclipse ] : Eclipse is a multi-language software development environment comprising an integrated development environment (IDE) and an extensible plug-in system. (http://en.wikipedia.org/wiki/Eclipse_%28software%29)

[ Sysdeo Eclipse Tomcat Launcher plugin ] : Registering Tomcat process to Eclipse debugger. (http://www.eclipsetotale.com/tomcatPlugin.html)

1. Environment

Ubuntu 10.04

JDK 1.6.0 u27

Apache Tomcat 7.0.22

Eclipse jee helios SR2

Sysdeo Eclipse Tomcat Launcher plugin (tomcatPluginV33.zip, http://www.eclipsetotale.com/tomcatPlugin.html)

2. Steps

2.0 Install JDK , Tomcat and Extract Eclipse

2.1 Extract tomcatPluginV33.zip to the directory {ECLIPSE_HOME}/plugins

2.2 Configure Tomcat plugin in Eclipse
Eclipse -- Window -- Preferences -- Tomcat -- choose tomcat version(I choose version 7.x here) -- browse and find the Tomcat home(which is where you installed Tomcat, my directory is /home/yineng/program/apache-tomcat-7.0.22) -- ok

2.3 Now you can start up and shut down tomcat by click some buttons in Eclipse, it's nice

2.4 Next, test Tomcat and Eclipse together
1) Eclipse -- choose Java EE mode -- File -- New -- Project -- Dynamic Web Project -- set project name and finish
2) Add a jsp file into the project -- the following is a sample of jsp

<html>
<body>
<%java.util.Date d =new java.util.Date();%>
Todays date is <%= d.getDate()%> and this jsp page worked!
</body>
</html>

3) Start Tomcat using Sysdeo plug-in
4) Launch a browser, go to http://localhost:{your port number}/{your project name} (my instance is http://localhost:8080/TomcatProject) and view your index.jsp file

2.5 OK, you should now have Eclipse set up and configured to work with Tomcat, that's great, have fun!

3. Notes

3.1 In 2.2, there is another set up item, "Context declaration mode", let you choose to change {TOMCAT_HOME}/conf/server.xml or add a context file to tomcat context files folder({TOMCAT_HOME}/conf/Catalina/) when you add a web site to Eclipse

4. Reference

http://www.ibm.com/developerworks/cn/opensource/os-ectom

http://www.ibm.com/developerworks/library/os-ectom/index.html

转载于:https://www.cnblogs.com/chenyineng/archive/2011/10/08/2201080.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值