File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes two servlet class in same context root Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "two servlet class in same context root" Watch "two servlet class in same context root" New topic

two servlet class in same context root

Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
Dear sir

How can i add two servlet class with diffrent allias under same context root using sun microsystem application server ?

with regard
Arun kumar maalik
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

Declare them both.

That's the best answer that can be given using the scant information you've provided. Want better answers? Ask better questions.

[Asking smart questions] [About Bear] [Books by Bear]
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

Do the two servlets have the same class name and package name? They can't.

If it's just two Servlets with the same name, but different package/folder names, then you can give them two different names in the web.xml file, and have appropriate name point to the appropriate Servlet.

Sounds easy.
[ August 27, 2006: Message edited by: Bear Bibeault ]
I agree. Here's the link:
subject: two servlet class in same context root
jQuery in Action, 3rd edition