aspose file tools*
The moose likes Servlets and the fly likes Create two instances for a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Create two instances for a servlet" Watch "Create two instances for a servlet" New topic
Author

Create two instances for a servlet

vinaykrothapalli kumar
Greenhorn

Joined: Aug 29, 2005
Posts: 12
Hi friends,
how can we create two instances of a servlet?
please help me
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

If you give the same servlet multiple mappings it will create a separate instance for each mapping. What are your requirements?
Anoop Kavalloor
Greenhorn

Joined: Sep 06, 2004
Posts: 15
To create two instance of the servlet, in the Deployment Descriptor, make two tags of the servlet. That should do the trick.


I am not completely useless.<br />I can be used as a bad example.<br /> <br />SCJP 1.4
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"Unqualified Genius",
You have already rrecieved a warning about your display name here.

Please correct it immediately or your account will be deleted.

thanks,
David O'Meara
Moderator.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by David O'Meara:
If you give the same servlet multiple mappings it will create a separate instance for each mapping. What are your requirements?


Did you mean multiple servlet entries, David?
Multiple mappings can point to the same instance.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

You were quite right to correct me, poor choice of words from me. I was referring to the steps-from-servlet-class-to-url mapping in a mathematical sense.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Create two instances for a servlet