首先下载tomcat插件: http://www.eclipsetotale.com/tomcatPlugin.html,下载最新的3.3版本;

由于我的eclipse是通过yum自动安装的,因此eclipse在默认的路径下/usr/lib/eclipse/,将tomcat插件解压后,把com.sysdeo.eclipse.tomcat_3.3.0文件夹放在eclipse默认路径下的/plugins路径下;

然后重启eclipse,即可看到有tomcat图标了。

配置tomcat的文章,参考:http://blog.csdn.net/njchenyi/article/details/6042760,虽然是windows的,但没有本质差别;

创建servlet,参考:http://blog.csdn.net/njchenyi/article/details/6042763

使用命令行,也可以编译servlet.

首先,将编译用的api文件拷贝到java文件同一目录下,我用的是/usr/share/java/servlet_2_4_api.jar;

然后使用javac -classpath servlet_2_4_api.jar HelloWorldExample11.java进行编译;即可生成class文件;

HelloWorldExample11.java代码如下:

import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

/**
* The simplest possible servlet.
*
* @author James Duncan Davidson
*/

public class HelloWorldExample11 extends HttpServlet {

public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
ResourceBundle rb =
ResourceBundle.getBundle("LocalStrings",request.getLocale());
response.setContentType("text/html");
PrintWriter out = response.getWriter();

out.println("<html>");
out.println("<head>");

String title = rb.getString("helloworld.title");

out.println("<title>" + title + "</title>");
out.println("</head>");
out.println("<body bgcolor=\"white\">");

// note that all links are created to be relative. this
// ensures that we can move the web application that this
// servlet belongs to to a different place in the url
// tree and not have any harmful side effects.

// XXX
// making these absolute till we work out the
// addition of a PathInfo issue

out.println("<a href=\"../helloworld.html\">");
out.println("<img src=\"../images/code.gif\" height=24 " +
"width=24 align=right border=0 alt=\"view code\"></a>");
out.println("<a href=\"../index.html\">");
out.println("<img src=\"../images/return.gif\" height=24 " +
"width=24 align=right border=0 alt=\"return\"></a>");
out.println("<h1>" + title + "</h1>");
out.println("</body>");
out.println("</html>");
}
}

fedora下eclipse安装tomcat插件的更多相关文章

  1. windows下Eclipse安装Perl插件教程

    windows下Eclipse安装Perl插件教程 想用eclipse编写perl.网上看了很多资料.但EPIC插件的下载连接都失效了.无奈,只好自己动手写个教程记录一下. 准备工作: 安装好Ecli ...

  2. JavaのEclipse安装Tomcat插件

    由于我装的eclipse是SE版,所以没有Servlet项目,需要自己安装插件. 一:首先到Tomcat的官网下载对应Tomcat版本. http://tomcat.apache.org/ 现在tom ...

  3. 初窥Java--2(下载Eclipse,安装tomcat插件)

    一.软件下载 Eclipse3.6 IDE for Java EE Developers: 下载地址:http://eclipse.org/downloads/ Tomcat Eclipse Plug ...

  4. java:eclipse安装tomcat插件及配置tomcat

    我们都知道myeclipse自带tomat图标,而eclipse却没有,若想eclipse实现带有tomcat图标可以下载tomcat插件 tomcat插件下载地址:http://www.eclips ...

  5. mac下eclipse安装svn插件-subclipse

    目前Eclipse最常用的svn插件莫非subclipse,在windows系统下的安装svn client和subclipse比较简单.本文介绍如何在mac安装svn插件和subclipse. 一. ...

  6. Mac 下eclipse安装Lombok插件

    在官网下载最新版本的 JAR 包. 将 lombok.jar 放在eclipse安装目录下,和 eclipse.ini 文件平级的. 注意,mac操作系统下eclipse的安装路径下有两个eclips ...

  7. ubuntu下eclipse安装maven插件

    ubuntu科输入如下指令安装eclipse:sudo apt-get install eclipse ubuntu下安装maven插件打开Eclipse点击Help -> Install Ne ...

  8. window下eclipse安装python插件

    1.安装python环境 python安装包下载地址:https://www.python.org/downloads/windows/ 2.在eclipse中在线安装PyDev插件 启动Eclips ...

  9. Mac下eclipse安装SVN插件

    eclipse中最常使用的SVN插件是subclipse,先到subclipse官网:http://subclipse.tigris.org下载该插件.   如上图,点击“Download and I ...

随机推荐

  1. vue.js_06_vue.js的自定义指令和自定义键盘修饰符

    1.全局的自定义指令 实现:当页面刷新时,光标聚焦到搜索框中 <label> 搜索: <input type="text" class="form-co ...

  2. vector容量器的应用

    vector容器的应用,感觉最近做的题目还用的挺多 vector与常用数组大部分是相同的,可以进行插入,删除之类的,但是,有些题目,用普通的数组就很容易爆掉,而vector可以动态的根据你所需要的来调 ...

  3. 一个班六个人,学号语文、数学、英语,接收成绩(不接受学号),输出学号成绩,总分、平均分,按总分排序(原生JS)

    <!doctype html> <html> <head> <meta charset="utf-8"> <title> ...

  4. Jmeter分布式测试过程中遇到的问题及摘抄前辈问题汇总

    遇到的常见问题: 1.在Controller端上控制某台机器Run,提示"Bad call to remote host". 解决方法:检查被控制机器上的jmeter-server ...

  5. python多进程,进程池,数据共享,进程通信,分布式进程

    一.操作系统中相关进程的知识   Unix/Linux操作系统提供了一个fork()系统调用,它非常特殊.普通的函数调用,调用一次,返回一次,但是fork()调用一次,返回两次,因为操作系统自动把当前 ...

  6. postfix+自签证书,实现加密传输

    说明:当前在centos 6.x环境下: cd /etc/pki/tls/misc ./CA -newca ..... 生成根证书 openssl req -new -nodes -keyout ma ...

  7. 入门servlet:request获取请求参数通用方式

    一.获取请求参数通用方式 1. String getParameter(String name):根据参数名称获取参数值 例:username=flypig&password=2343 2. ...

  8. Python numpy.transpose 详解

    前言 看Python代码时,碰见 numpy.transpose 用于高维数组时挺让人费解,通过一番画图分析和代码验证,发现 transpose 用法还是很简单的. 正文 Numpy 文档 numpy ...

  9. mongodb 使用常见问题汇总(主要是集群搭建)

    1 安装 请使用官方推荐的教程 https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ 2 远程访问失败: 操作系统是u ...

  10. C#调用C++ DLL动态库的两种方式

    第一种方式:C++导出函数, c#dllimport 的方式 在很多地方都看到过,如[dllimport "user32.dll"]这种代码,调用windows API,就是通过这 ...