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 to make two instances of servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to make two instances of servlet" Watch "How to make two instances of servlet" New topic

How to make two instances of servlet

Malhar Me

Joined: Jun 22, 2009
Posts: 27

Will it create 2 instance of a servlet by writing 2 different names in we.xml for the same servlet class.

Ankit Garg

Joined: Aug 03, 2008
Posts: 9462

Yes, for each different name that the servlet is registered with, a different instance of the servlet will be created...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844


[Asking smart questions] [About Bear] [Books by Bear]
Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489

It might One Servlet Java Class mapped with two different URL..

correct me if i'm wrong..

Sorry, perhaps my english language isn't too good.. Prepare for SCJP 6, Please God help me.. ☼
References : [Java.Boot] [JavaChamp] [JavaPrepare]
I agree. Here's the link:
subject: How to make two instances of servlet
It's not a secret anymore!