转载 jakarta tomcat与Apache Tomcat 有什么区别

转载地址: http://hi.baidu.com/luckytimes/blog/item/335f7106619f1a7e02088103.html

 

 

1)apache是一个开源的组织名。后来制定了一个以apache命名的开源协议。 
jakarta是apache组织下的一套Java解决方案的开源软件的名称,它包括了很多子项目。Tomcat,ant,struts等等也是apache下的开源项目。同时也是jakarta的关联项目。 
官网:www.apache.org
(分别点击左边的“jakarta”和“tomcat”可以分别进入jakarta页http://jakarta.apache.org/和Apache tomcat页http://tomcat.apache.org/,找到它们页面上的archives即可以进入它们各自的tomcat存档,哈,其实都是一样的啦。其实都在这里http://archive.apache.org/dist/啦,找到其中的tomcat和jakarta就可以啦)

2)最开始,所有关于Java的项目,都集中在Apache的Jakarta项目之下,作为子项目存在,这时的Tomcat称为Jakarta Tomcat。后来,Jakarta下面项目太多,就开始分家了,如Ant、tomcat等等,所以现在称Apache Tomcat。实际是一回事儿。


3)apache是多平台下优秀的web服务程序,apache本身只能提供静态页面服务,要解释脚本语句。
例如php,jsp,perl等就需要其他程序来支持。
tomcat是jsp解释器,所以要让apache解释jsp文件就需要它根tomcat整合。


4)apache是HTTP服务器 ,用来接收及处理客户请求(但是只是静态页面服务) ,Tomcat严格的说是jsp引擎 , 服务器收到请求后判断是否jsp文件,是,则由jsp引擎(eg: tomcat)将jsp代码转换成Servlet码 ,再通知服务器上的java编译器(eg:JDK)将Servlet字节码编译成class文件(文件一般放在Tomcat的work目录下),最后由JVM执行class文件 , 把结果以html代码形式返回client .

 

 

————————————————————————————————————————————————————————

 

下载之后

可以Copy到 /usr/local/

Original link: http://developer.apple.com/internet/java/tomcat1.html

 

 

 

Starting and Stopping Tomcat

Tomcat expects certain environment variables to be defined before it starts. In order to simplify the startup and shutdown processes, you can create re-usable scripts. I usually store scripts like these in a directory called binunder my home directory. (That’s pretty standard in the Unix world.)

liz@localhost:~> mkdir bin
liz@localhost:~> cd bin
liz@localhost:bin>

Now you can create a file (using your favorite text editor, must be saved with unix line endings) called~/bin/start_tomcat with the following contents:

#!/bin/sh
export CATALINA_HOME=/usr/local/jakarta-tomcat-4.0.1
export JAVA_HOME=/usr
$CATALINA_HOME/bin/startup.sh

And a file called ~/bin/stop_tomcat with these contents:

#!/bin/sh
export CATALINA_HOME=/usr/local/jakarta-tomcat-4.0.1
export JAVA_HOME=/usr
$CATALINA_HOME/bin/shutdown.sh

Finally, you must make these files executable:

liz@localhost:bin> chmod ug+x start_tomcat stop_tomcat 

Tomcat as a Stand-alone Service

Tomcat comes with a built-in HTTP server. By default, it runs as a stand-alone service on port 8080. You’ll learn how to use Tomcat with Apache below. If you’d rather use Tomcat by itself on port 80, you can change the port value in your server.xml file, as you’ll see shortly. For now, you can start Tomcat using the script you just created.

liz@localhost:~> ~/bin/start_tomcat

 

Eclispe download

 

create a Dynamic project, under Web folder.

 

create a index.jsp file under WebContent (index.jsp default mainpage under "XXX:8080/ProjectName/"     url)

 

or you can change the default welcome page in this xml file   /usr/local/jakarta-tomcat-4.0.1/conf/server.xml

 

create a Servlet and put some sentences in doGet function, either response.getWriter().write("Hello, world!");

or return a page code 

 

    {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

        out.println("<html>");
        out.println("<head>");
        out.println("<title>Hola</title>");
        out.println("</head>");
        out.println("<body bgcolor=/"white/">");
        out.println("<h1> Hi </h1>");
        out.println("</body>");
        out.println("</html>");
    }
Or your can create another email Servlet, below is the template of mail servlet file 
http://developer.apple.com/internet/java/examples/mailjava.html
export / setenv
CLASSPATH="$CLASSPATH:/usr/local/"tomcatHome"/common/lib/mail.jar"
------------------------------------------------------------------------------------------------------------------------------------------------
 
Servlet and MySQL 
Ref: http://blog.csdn.net/woxihuanbohe/archive/2011/04/07/6307699.aspx

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值