This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How many different ways to create Servlets ?" Watch "How many different ways to create Servlets ?" New topic
Author

How many different ways to create Servlets ?

Sudha
Greenhorn

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 ?

Thanks,
Suda
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61082
    
  66

"Sudha",

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.

Thanks!
bear
JavaRanch Sheriff


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

Joined: Mar 22, 2005
Posts: 41591
    
  55
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 ]

Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How many different ways to create Servlets ?