> We had all our URL's (except our login form) stored in the web.xml file as
> input parameters to out servlets, so I created a new context,altered the
> URL's to include the context name, and started the tomcat server.  It now
> appears to be working fine under the new context.  

If you used the "default" web.xml all you need to do is to move the config
information in your webapp's web.xml.

It should work fine - and your app will be portable to any other container
( without requiring any change in the server config )


> I noticed that the defaultServlet, etc. were being loaded prior to my new
> context, and I am able to run with the new context only defining my
> servlets.  Are the default servlets, and mime-types, etc being loaded
> through an XML file, or by some other means?  

The "defaultServet" no longer exists - static files are handled by the
StaticInterceptor, a tomcat module that is much faster. You can still
define a "defaultServlet" in your application - and again do it in a
portable way. Same is true for mime-types - all configuration that is
needed by a web application should be in that application's web.xml.

If you want to alter tomcat's functionality ( for example use a different
module to handle static files ) you'll use server.xml.

The reasons for using a module instead of going to a servlet layer - the
code is much faster ( it cuts one layer, has access to all tomcat
internals ), and (IMHO) much more flexible and consistent with the tomcat
structure. It is very easy to configure tomcat to use a servlet for static
files, but it'll be slower.

Costin 

Reply via email to