Monday, June 28, 2010

Introduction to Domino servlets - Part 1

Domino servers support Java servlets.  According to wikipedia, servlets are "a Java class which conforms to the Java Servlet API, a protocol by which a Java class may respond to http requests".

For the Domino developer, it is easiest to think of servlets as Java web agents that sit outside a database.  There are two advantages of using servlets over standard Java web agents:
  1. They are not constrained by the limitations of agents inside a database.  So, for example, a servlet can access the raw HTTP data sent by the browser - whereas this information is already pre-processed in a standard agent and cannot be accessed.  In addition, a servlet can send binary data to a browser - an agent cannot.
  2. They are only loaded into memory the first time they are called.  This means they run more efficiently than standard web agents -  which are loaded into memory every time they run.

In order to use Java servlets, your Domino server needs to enable the Domino Servlet Manager. This is done in the Internet Protocols... section of the server configuration document:


There are a series of configuration options for Java servlets, however, the default options will generally suffice.  You will need to restart the server once the servlet manager has been enabled.

Part 2 of this post will examine how to write a servlet in Java.  The final part will examine how to implement and call them from your Domino server.

No comments:

Post a Comment