wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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: 60804
    
  65

"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: 41150
    
  45
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
 
 
subject: How many different ways to create Servlets ?
 
Similar Threads
Is it allowed to create threads inside servlets?
Deploying a servlet
J2EE Environment Variables
Passing the session variable from one HTML to JSP through Servlets?
Un-downloadable Applets