File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 60050
    
  65

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

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 ]
 
wood burning stoves
 
subject: two servlet class in same context root
 
Similar Threads
Please help for Context root
Session Attributes and ServletContext
Definitions and usage of getContext()
question on servlet-mapping
Problem accessing jsp Page