InfoCenter Home >
6: Administer applications >
6.6: Tools and resources quick reference >
6.6.9: Administering servlets (overview)

6.6.9: Administering servlets (overview)

The servlet developer will create a servlet class file and either provide the file to the administrator or notify the administrator of the file's location on a machine in the WebSphere administrative domain.

For an "explicitly configured servlet," the administrator specifies properties such as:

  • The administrative name and actual class name

  • The Web application to which the servlet belongs

  • Servlet initialization parameters

  • Whether to start the servlet in Java debug mode

  • Web paths by which the servlet can be requested

  • Whether to load the servlet when the application server starts, or wait until the servlet is requested

An "implicitly configured servlet" resides in a directory specified to hold servlets for a Web application, and can be invoked only if the Web application is enabled to serve by classname. This is accomplished by adding a certain WebSphere internal servlet to the Web application.

Approaches to administering servlets

The administrator can represent the servlet a few ways in the administrative domain:

  • As an explicit servlet resource belonging to a Web application

    The administrator can "explicitly" configure a servlet resource to represent and manage the servlet class file in the administrative domain.

    The servlet must be associated with a Web application. The Web application classpath tells where to find the servlet class file in the WebSphere Application Server product directories.

  • As an implicit part of a Web application

    As previously stated, the Web application classpath contains the servlet class file location.

    The classpath does not have to reference the exact servlet class file name. Instead, it can reference a servlet directory for the Web application. The servlet directory can contain several servlets whose particular class names are unknown to administrative domain. The servlets need not exist as explicitly configured servlet resources.

    To use this approach, you need to add a particular WebSphere internal servlet to the Web application, for serving servlets by their classnames.

  • As part of an enterprise application

    After a servlet is added to the administrative domain one way or the other, the administrator can add it to an enterprise application.

    A servlet resource cannot be added to an enterprise application directly, but can be added as part of a Web application.

An explicitly configured servlet can be monitored, but an implicitly configured servlet cannot. If the administrator requires statistics such as requests and execution time, he or she should explicitly configure the servlet.

WebSphere Studio configuration files

Unless creating your servlets in the Studio product, disregard this section. It discusses the handling of .servlet files generated by the IBM WebSphere Studio product.

Whenever WebSphere Application Server Version 3 loads a servlet, it looks for an accompanying .servlet file specifying initialization parameters and configuration information for the servlet.

To be found, the .servlet file must reside in the same directory as the servlet. No further action is required to use .servlet files in WebSphere Application Server Version 3.

The WebSphere Administrative Console does not display .servlet files, even if they are present. However, it will display the servlet and its configuration if you define the servlet in the administrative domain.

If using the console to specify servlet settings, make sure they do not conflict with those defined in the .servlet file. In such a case, it is likely, but not definite, that the console settings will override the .servlet file settings.

Go to previous article: Precompiling JSP files for Web modules of an application with the Web console Go to next article: Servlet properties

 

 
Go to previous article: Precompiling JSP files for Web modules of an application with the Web console Go to next article: Servlet properties