Servlet : Java Glossary

*0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ (all)

Servlet
an application designed to run on a server in the womb of a permanently resident CGI (Common Gateway Interface) mother program written in Java that provides services for it, much the way an Applet runs in the womb of a Web browser.

Servlet Advantages

Servlets have the following advantages over CGI.

Servlet Extensions

It gets tedious writing Servlets that embed reams of HTML (Hypertext Markup Language) inside Java strings, since your outputs are complete HTML pages. So people have created scores of rinky dink ways of embedding Java code in HTML that gets compiled into the equivalent Java Servlet code dynamically. I find them all disgustingly amateurish. You might have a look at some of the choices of framework.

There are various ways of writing server code that build on top of the basic Servlet classes. JSP (Java Server Pages) 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 (extensible Markup Language)

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

The big puzzle to the novice is where are the jars for the Servlet classes?
// imports used in Servlets
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;

Sun does not provide the jars. You get them from your servlet womb vendor — his particular implementation of the interfaces. If you use Caucho Resin, it will automatically use its version of the classes and automatically recompile your java source as-needed. You have to read the womb docs. Often they make you copy the entire set of system jars to your own directory for use.

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.HttpServlet docs : available:
javax.servlet.http package docs : available:
javax.servlet package docs : available:

Books

book cover recommend book⇒Head First Servlets and JSP: Passing the SCJP Oracle Certified Web Component Developer Examto book home
by Bryan Basham, Kathy Sierra, Bert Bates 978-0-596-51668-0 paperback
publisher O’Reilly recommended 978-1-4493-6086-3 eBook
published 2008-08-07 B009Z45JAI kindle
A very complete book, partly because it aims to prepare you for the Oracle exam. It is also a difficult book.
Australian flag abe books anz abe books.ca Canadian flag
German flag abe books.de amazon.ca Canadian flag
German flag amazon.de Chapters Indigo Canadian flag
Spanish flag amazon.es Chapters Indigo eBooks Canadian flag
Spanish flag iberlibro.com abe books.com American flag
French flag abe books.fr amazon.com American flag
French flag amazon.fr Barnes & Noble American flag
Italian flag abe books.it Nook at Barnes & Noble American flag
Italian flag amazon.it Kobo American flag
India flag junglee.com Google play American flag
UK flag abe books.co.uk O’Reilly Safari American flag
UK flag amazon.co.uk Powells American flag
UN flag other stores
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder.
book cover recommend book⇒Core Servlets and Javaserver Pages: Advanced Technologies, Vol. 2, second editionto book home
by Marty Hall, Larry Brown, Yaakov Chaikin 978-0-13-148260-9 paperback
publisher Prentice Hall 978-0-13-271568-3 eBook
published 2007-12-01 B004YWAZFA kindle
Complete text of the book available on line in pdf format.
Australian flag abe books anz abe books.ca Canadian flag
German flag abe books.de amazon.ca Canadian flag
German flag amazon.de Chapters Indigo Canadian flag
Spanish flag amazon.es Chapters Indigo eBooks Canadian flag
Spanish flag iberlibro.com abe books.com American flag
French flag abe books.fr amazon.com American flag
French flag amazon.fr Barnes & Noble American flag
Italian flag abe books.it Nook at Barnes & Noble American flag
Italian flag amazon.it Kobo American flag
India flag junglee.com Google play American flag
UK flag abe books.co.uk O’Reilly Safari American flag
UK flag amazon.co.uk Powells American flag
UN flag other stores
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder.
book cover recommend book⇒Developing Enterprise Java Applications with EE and UMLto book home
by Khawar Zaman Ahmed, Cary E. Umrysh 978-0-201-73829-2 paperback
publisher Addison-Wesley
published 2001-10-27
Australian flag abe books anz abe books.ca Canadian flag
German flag abe books.de amazon.ca Canadian flag
German flag amazon.de Chapters Indigo Canadian flag
Spanish flag amazon.es Chapters Indigo eBooks Canadian flag
Spanish flag iberlibro.com abe books.com American flag
French flag abe books.fr amazon.com American flag
French flag amazon.fr Barnes & Noble American flag
Italian flag abe books.it Nook at Barnes & Noble American flag
Italian flag amazon.it Kobo American flag
India flag junglee.com Google play American flag
UK flag abe books.co.uk O’Reilly Safari American flag
UK flag amazon.co.uk Powells American flag
UN flag other stores
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder.
book cover recommend book⇒Web Development with JavaServer Pagesto book home
by Duane K. Fields, Mark A. Kolb, Shawn Bayern 978-1-930110-12-0 paperback
publisher Manning
published 2001-09-15
A very thorough treatment.
Australian flag abe books anz abe books.ca Canadian flag
German flag abe books.de amazon.ca Canadian flag
German flag amazon.de Chapters Indigo Canadian flag
Spanish flag amazon.es Chapters Indigo eBooks Canadian flag
Spanish flag iberlibro.com abe books.com American flag
French flag abe books.fr amazon.com American flag
French flag amazon.fr Barnes & Noble American flag
Italian flag abe books.it Nook at Barnes & Noble American flag
Italian flag amazon.it Kobo American flag
India flag junglee.com Google play American flag
UK flag abe books.co.uk O’Reilly Safari American flag
UK flag amazon.co.uk Powells American flag
UN flag other stores
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder.
book cover recommend book⇒Inside Servlets: Server-Side Programming for the Java(TM) Platform, second editionto book home
by Dustin R. Callaway, Danny Coward 978-0-201-70906-3 paperback
publisher Addison-Wesley
published 2001-05-14
Australian flag abe books anz abe books.ca Canadian flag
German flag abe books.de amazon.ca Canadian flag
German flag amazon.de Chapters Indigo Canadian flag
Spanish flag amazon.es Chapters Indigo eBooks Canadian flag
Spanish flag iberlibro.com abe books.com American flag
French flag abe books.fr amazon.com American flag
French flag amazon.fr Barnes & Noble American flag
Italian flag abe books.it Nook at Barnes & Noble American flag
Italian flag amazon.it Kobo American flag
India flag junglee.com Google play American flag
UK flag abe books.co.uk O’Reilly Safari American flag
UK flag amazon.co.uk Powells American flag
UN flag other stores
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder.
book cover recommend book⇒Java Servlet Programming, second editionto book home
by Jason Hunter, William Crawford 978-0-596-00040-0 paperback
publisher O’Reilly recommended 978-1-4493-9067-9 eBook
published 2001-03-01 B0043M4Z8E kindle
highly recommended. Covers basics of JSP too.
Australian flag abe books anz abe books.ca Canadian flag
German flag abe books.de amazon.ca Canadian flag
German flag amazon.de Chapters Indigo Canadian flag
Spanish flag amazon.es Chapters Indigo eBooks Canadian flag
Spanish flag iberlibro.com abe books.com American flag
French flag abe books.fr amazon.com American flag
French flag amazon.fr Barnes & Noble American flag
Italian flag abe books.it Nook at Barnes & Noble American flag
Italian flag amazon.it Kobo American flag
India flag junglee.com Google play American flag
UK flag abe books.co.uk O’Reilly Safari American flag
UK flag amazon.co.uk Powells American flag
UN flag other stores
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder.
Applet vs Servlet
ASP
Catalina
CGI
Code Charge: generates servlets
cookie
EE
framework: list of possible frameworks
HTML static macros
ISP: list of ISPISP vendors who will host servlets
JDBC: list of JDBCJDBC vendors
JSP
JSR 315: coming Servlet 3 spec
LAMP
Novocode Servlet Essentials Tutorial
PHP
server
servlet womb
template engine
Tomcat
web container
where to find jars
womb

This page is posted
on the web at:

http://mindprod.com/jgloss/servlet.html

Optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\servlet.html
Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

IP:[65.110.21.43]
Your face IP:[3.145.92.98]
You are visitor number