Java Servlets - Loading and Invoking

Servlet Loading and Invoking (Beta)
Documentation
Where are Servlets Loaded From?
Servlets can be loaded from 3 places:
- From a directory that is on the CLASSPATH. The CLASSPATH of
the JavaWebServer includes service_root/classes/ which is
where the system classes reside.
- From the /servlets/ directory. This is *not* in
the server's classpath. A classloader is used to create servlets
from this directory. New servlets can be added - existing servlets
can be recompiled and the server will notice these changes.
- From a remote location. For this a codebase like http://nine.eng/classes/foo/
is required in addition to the servlet's class name. Refer to the admin GUI
docs on servlet section to see how to set this up.
Remote Servlets
Remote servlets can be loaded on to the server by:
- the admin tool
by configuring the servlets section there.
- the server side include tags in .shtml files
- the filter chain configuration
Remote servlets have security
implications.
How Are Servlets Identified?
Servlets are identified by <servletName> which is either:
- a virtual name that is assigned to the servlet via the
servlet section of the Admin GUI.
- by its own class name if the servlet is dropped into the
/servlets/ directory and invoked by its class name.
How Are Servlets Invoked?
Servlets are loaded and invoked by:
- invoking http://<server:port>/servlet/
- mapping a URL to a using the
servlet aliases
section of the admin GUI and invoking the URL
- using a server side include tag
- using a filter chain - where a servlet is configured to be invoked
when a particular mime type is set as the response. Please refer to
the filters section for more on this.
NOTE: <servletName>> is any valid servlet identifier as described in
the previous section.
Top
java-server-feedback@java.sun.com