![]() |
![]() Servlet configuration follows the Servlet 2.2 deployment descriptors. Servlets generally belong in the directory of the web application. The mapping from url to servlet is controlled by servlet mapping in the application configuration. For a complete, working example, see Servlet or experiment with the Hello, World demo.
Defines a servlet alias for later mapping.
The following example defines a servlet alias 'hello'
Alias of the servlet
Class of the servlet The CLASSPATH for servlets includes
the WEB-INF/classes directory and all jars in the WEB-INF/lib directory.
Initializes servlet variables.
servlet-param
defines initial values for getServletConfig().getInitParameter("foo") .
The full servlet 2.2 syntax is supported and allows a simple shortcut
If present, starts the servlet when the server starts.
If present, executes the servlet at the specified times.
<run-at> lets servlet writers execute periodic tasks without worrying
about creating a new Thread.
The value is a list of 24-hour times when the servlet should be automatically executed. To run the servlet every 6 hours, you could use
If the hour is omitted, the servlet runs every hour at the specified minute. To run the server every 15 minutes, you could use:
|