2. apachetomcattraining.vibranttechnologies.co.in
What is Tomcat?
Tomcat is a Servlet container (Web server that
interacts with Servlets) developed under the
Jakarta Project of Apache Software Foundation
Tomcat implements the Servlet and the Java
Server Pages (JSP) specifications of Sun
Microsystems
Tomcat is an open-source, non commercial project
Licensed under the Apache Software License
Tomcat is written in Java (OS independent)
B2/6/2 Vashi ,Navi Mumbai,
Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
3. apachetomcattraining.vibranttechnologies.co.in
A Servlet Example
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
out.println("<html><head><title>Hello</title></head>");
out.println("<body>");
out.println("<h2>" + new java.util.Date() + "</h2>");
out.println("<h1>Hello World</h1></body></html>");
}
http://localhost/dbi/hello
B2/6/2 Vashi ,Navi Mumbai,
Contact:09892900103/9892900173
}
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
4. apachetomcattraining.vibranttechnologies.co.in
A JSP Example
<html>
<head>
<title>Hello World</title>
</head>
<body>
<h2><%= new java.util.Date() %></h2>
<h1>Hello World</h1>
</body>
http://localhost/dbi/hello.jsp
</html>
B2/6/2 Vashi ,Navi Mumbai,
Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
5. apachetomcattraining.vibranttechnologies.co.in
The Apache Jakarta Project
• The Apache Jakarta Project “creates and maintains
open source solutions on the Java platform for
distribution to the public at no charge”
• Apache Jakarta Tomcat--or just “Tomcat”--is one of
those projects
• Tomcat is a container for servlets
– Tomcat can act as a simple standalone server for Web
applications that use HTML, servlets, and JSP
– Apache is an industrial-strength, highly optimized server
that can be extended with Tomcat
B2/6/2 Vashi ,Navi Mumbai,
Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
6. apachetomcattraining.vibranttechnologies.co.in
Getting Tomcat
• The Apache Jakarta website is hard to navigate
• If you want to get Tomcat, one reasonable download site is
http://mirrors.xtria.com/apache/jakarta/tomcat5/v5.0.29/bin/
• You would need the whole “tarball”, which will have a name such as
jakarta-tomcat-5.0.29.tar.gz
• An excellent tutorial site is Configuring & Using Apache Tomcat,
http://www.coreservlets.com/Apache-Tomcat-Tutorial/
– This site also contains many examples you can use to test your installation
• Installing Tomcat by itself is much easier than installing Apache and
then adding Tomcat to it
B2/6/2 Vashi ,Navi Mumbai,
Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
9. apachetomcattraining.vibranttechnologies.co.in
Base and Home Directories
• The directory TOMCAT-HOME contains
executables and libraries required for the server
launching, running and stopping
– This directory is placed under /usr/local/…
• The directory TOMCAT-BASE contains the
Web-site content, Web applications and
configuration data
– This directory is placed under your home directory
B2/6/2 Vashi ,Navi Mumbai,
Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
10. apachetomcattraining.vibranttechnologies.co.in
Tomcat directory structure
myApplicationDirectory/ -- this is your top level directory
myWebForm.html
myJspPage.jsp
WEB-INF/ -- must have this directory, named exactly like this
lib/ -- mostly for external .jar files
classes/ -- must have this directory, named exactly like this
com/ -- The com.example.model package directory
example/
model/
myModel.class -- in package com.example.model;
web/
myServlet.class --in package com.example.web;
web.xml -- this is the deployment descriptor, it must have this name
B2/6/2 Vashi ,Navi Mumbai,
Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
11. androidtraining.vibranttechnologies.co.in
Where to Get More Information
Vibrant Group:
www.vibrantgroup.co.in
Vibrant Technologies & Computers
www.vibranttechnologies.co.in/technologies.vibrantgroup.co.
in
Vibrant HR Team
www.hr.vibrangroup.co.in
B2/6/2 Vashi ,Navi Mumbai,
Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in