File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes How many different ways to create Servlets ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How many different ways to create Servlets ?" Watch "How many different ways to create Servlets ?" New topic

How many different ways to create Servlets ?


Joined: Feb 25, 2007
Posts: 2
Hi all,

We can create servlets by ;

a) Servlets by extending two classes and over write methods
b) retrive the existing Servlets from the pool

Is there any other way to create Servlets ?

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 62505


There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

JavaRanch Sheriff

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42955
I'm not sure that I understand your question. You create a servlet by declaring it in the web.xml file. The class needs to implement the Servlet interface.

As to a), in Java a class can not extend two classes - only a single one. Or did you mean youj can either extend GenericServlet or HttpServlet?

As to b), what pool are you talking about?
[ February 25, 2007: Message edited by: Ulf Dittmer ]
I agree. Here's the link:
subject: How many different ways to create Servlets ?