Java Glossary : servlet

CMP home Java glossary home Menu no menu Last updated 2004-06-28 by Roedy Green ©1996-2004 Canadian Mind Products

Java definitions: 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

You are here : home : Java Glossary : S words : servlet.

servlet
an application designed to run on a server in the womb of a permanently resident CGI mother program written in Java that provides services for it, much the way an Applet runs in the womb of a Web browser. You can download the standard servlet extension API.

Servlet Advantages

Servlets have the following advantages over CGI.

Servlet Extensions

There are various ways of writing server code that build on top of the basic Servlet classes. JSP and Freemarker let you embed bits of Java code, and other scripting inside your HTML pages. These are parsed and converted to Java Servlet programs that dynamically generate HTML with variable fields. These are automatically recompiled as needed.

With JSP all you have to do is drop the *.jsp files in a magic directory and away you go. With Servlets you must put the *.class files or *.war files in a magic directory, and register the servlets in a web.xml file that maps application name to servlet class among other things.

Writing Servlets in XML

In the following web.app example, the user types http://localhost:8080/hello. That is mapped to a servlet named hello-world. That servlet is implemented by the Java Servlet test.HelloWorld.class.
<web-app>
<servlet-mapping url-pattern='/hello' servlet-name='hello-world'/>
<servlet servlet-name='hello-world' servlet-class='test.HelloWorld'/>
<init-param greeting='Hello, world'/>
</web-app>

Under the Hood

javax.servlet.Filter is an interface to allow a transaction to be processed in an assembly line. Each Filter does some of the work and passes on the input or output to the next filter in the chain, and decides on who is next.

Getting Started

Getting your first HelloServletWorld working can be quite a challenge.

Debugging Tips

Learning More

javax.servlet.http package docs : available:

javax.servlet package docs : available:

See this tutorial and sample code collection.

See this tutorial on Servlet Essentials.

book_coverCore Servlets and Java Server Pages
0-13-089340-4
Marty Hall
Complete text of the book available on line in pdf format.
amazon.com Barnes and Noble
amazon.ca chapters
amazon.co.uk amazon.de
book_coverCore Servlets and Java Server Pages
0-13-067614-4
Marty Hall
amazon.com Barnes and Noble
amazon.ca chapters
amazon.co.uk amazon.de
book_coverJava Servlet Programming
0-596-00040-5
Jason Hunter, William Crawford
highly reccommended.
amazon.com Barnes and Noble
amazon.ca chapters
amazon.co.uk amazon.de
book_coverWeb Development with JavaServer Pages
1-930110-12-X
Duane K. Fields, Mark A. Kolb, Shawn Bayern
amazon.com Barnes and Noble
amazon.ca chapters
amazon.co.uk amazon.de
book_coverInside Servlets: Server-Side Programming for the Java(TM) Platform (2nd Edition)
0-201-70906-6
Dustin R. Callaway, Danny Coward
amazon.com Barnes and Noble
amazon.ca chapters
amazon.co.uk amazon.de
book_coverDeveloping Enterprise Java Applications with J2EE and UML
0-201-73829-5
Khawar Zaman Ahmed, Cary E. Umrysh
amazon.com Barnes and Noble
amazon.ca chapters
amazon.co.uk amazon.de

See Sun's docs on the javax.servlet and javax.servlet.http packages that are common to all servlet implementation.

ASP ¤ CGI ¤ cookie ¤ ISP: list of ISP vendors who will host servlets ¤ J2EE ¤ Jay Eccles' Introduction ¤ JDBC: list of JDBC vendors ¤ JSP ¤ PHP ¤ server ¤ Servlet related Links ¤ servlet womb ¤ Sun's Servlet Tutorial ¤ womb


CMP logo
CMP_home
home
Canadian Mind Products CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[24.87.56.253]
Your IP:[80.134.30.163]
You are visitor number 2093.
Please send errors, omissions and suggestions
to improve this page to Roedy Green.
You can get a fresh copy of this page from: or possibly from your local J: drive mirror:
http://mindprod.com/jgloss/servlet.html J:\mindprod\jgloss\servlet.html