aspose file tools*
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


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 "two servlet class in same context root" Watch "two servlet class in same context root" New topic
Author

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
Marshal

Joined: Jan 10, 2002
Posts: 61043
    
  66

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] [Bear's FrontMan] [About Bear] [Books by Bear]
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

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 ]
 
jQuery in Action, 2nd edition
 
subject: two servlet class in same context root