Home | | Sitemap ||Page number :15

Syntax:

mimetypemap.total=[total number of the filter mappings] mimetypemap.[number].filter=[filter name] mimetypemap.[number].mimeType=[mime type]

Example:

mimetypemap.total=1 mimetypemap.1.filter=jsp mimetypemap.1.mimeType=java-internal/java-html

S

5.6.3 Locating other servlets and server extensions

Servlet chaining and content filtering are not the only ways to make several servlets to interact with each other. A servlet might want to utilise other servlets installed into the Nokia WAP Server e.g. in the following ways: Servlets in the Nokia WAP Server

37

Locating servlets via ServletContext One way to locate other servlets is to use the ServletContext services in the Java Servlet API. Once you have the servlet interface of another servlet, the service method of the located servlet can be called.
Locating server extensions A servlet might want to use a server extension that provides an implementation of some interfaces defined in the Server Extension API. In that case, the servlet can locate the desired extensions by using the QueryInterface and getProviders methods in the com.nokia.wap.server.WapServer interface.

5.7 Pre-installed servlets

There are some servlets pre-installed on the Nokia WAP Server. These include:

OTAProvisioning A servlet that makes it possible to send configurations to WAP phones for accessing WAP services. See the Nokia WAP Server 1.1 Administration Guide for further information on the use of the OTA Provisioning Tool.
FileServlet A servlet that provides access to files saved locally to the [installation directory]\wap_root directory. The servlet must be configured for various content types. See the Nokia WAP Server Administration Guide for further information on the use of the FileServlet.

The OTAProvisioning and FileServlet are features of the official Nokia WAP Server product. In addition to these servlets, there also are some samples with source code that are included in the product package to help developers to learn to write Java Servlets. These samples include e.g.:

HelloWorld The HelloWorld is a simple example of how to write Java Servlets. The servlet is also included in this document.
AckListenerSample The sample illustrates how the AckListener interface can be used to verify the delivery of the response. Also, the sample illustrates one of the ways of implementing session handling with the Nokia WAP Server.
WapRequestSample The sample illustrates how to obtain WAP-specific information from the WapRequest interface.
WMLTool The WMLTool sample illustrates how writing servlets to generate WML can be simplified by creating appropriate utilities. The related WMLToolSample illustrates the use of the WMLTool utility. See also the JavaDoc reference documentation in [installation directory]\servlets\samples\ WMLTool_doc for the details of the WMLTool sample.
HeaderSample The HeaderSample can be used to echo the HTTP headers back to the WAP terminal. This sample can be used e.g. together with the FilterSample. A simple servlet chain can be implemented according to the servlet chain configuration instructions in this document so that the FilterSample adds some information to the HTTP headers and the HeaderSample prints the headers back to the terminal.
FilterSample The FilterSample illustrates how information, such as WAP–specific information from the WAP Service API, can be added to HTTP headers that are then received by another servlet in a servlet chain or an origin server.

Servlets in the Nokia WAP Server

39

Note that the samples that are located in the [installation directory]\servlets\samples directory have to be configured with the package name (samples.servletname).

ASDS

Note that the above samples are provided for learning purposes only. Samples, such as the WMLTool, can be further developed to meet specific needs, but no official support or maintenance is provided for the samples.