GeeCON Prague 2014*
The moose likes Servlets and the fly likes Default Web application/ ServletContext Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Default Web application/ ServletContext" Watch "Default Web application/ ServletContext" New topic
Author

Default Web application/ ServletContext

Nagendra Inuguri
Ranch Hand

Joined: Jan 08, 2004
Posts: 76
This sentence is from servlet 2.4 specification.

�Servlets in a container that were not deployed as part of a web application are implicitly part of a �default� web application and have a default ServletContext.�

Question here is how can we deploy only servlets, which are not part of any web application? Could you give any example/use case why we need to deploy only independent servlets?


SCJP SCWCD SCDJWS SCBCD5 SCEA5
Lalit Nagalkar
Ranch Hand

Joined: Aug 22, 2006
Posts: 47
yes, we can deploy independent servlets
every container has a default web app folder

e.g Tomcat has ROOT in its webapps folder
this ROOT is the default webapp

if we store servlet here and in Tomcat conf file if the invoker servlet is
enabled (not commented out)then our servlet can be called as

server/servlet/MyServlet


SCJP 1.4
Nagendra Inuguri
Ranch Hand

Joined: Jan 08, 2004
Posts: 76
I think you have not answered my question completely.

Could you give any example/use case why we need to deploy servlets in a default web application?
 
GeeCON Prague 2014
 
subject: Default Web application/ ServletContext