H.3 SampleServlet.java

Source code for a sample servlet is included with the driver distribution. The source code is found in the file manualtask_driver_docs.zip in the distribution image.

The servlet is implemented in the com.novell.nds.dirxml.driver.manualtask.samples.SampleServlet class.

The sample servlet accepts an HTTP GET request for any resource ending in .sample. The query string of the HTTP URL must contain a dest-dn item, an attr-name item, and a value item.

The servlet authenticates the user, then submits a modify request to Identity Manager via the driver's Publisher channel.

H.3.1 Compiling the SampleServlet Class

You can use any Java 2 compiler to compile the SampleServlet class. You must place nxsl.jar, dirxml.jar, collections.jar, and ManualTaskServiceBase.jar in the Java compiler classpath.

H.3.2 Trying the SampleServlet Class

Start by importing the Room Number sample configuration for the driver.

Compile the SampleServlet class and place the resulting class file in a .jar file. Place the .jar file in the DirXML .jar file directory appropriate to the platform on which you are running the driver.

Edit the Driver Parameters. In the item labeled Additional Servlets, add the string com.novell.nds.dirxml.driver.manualtask.samples.SampleServlet.

Add Telephone Number to the Publisher channel filter.

Submit the following URL in a browser (assuming the browser is running on the same machine as the driver):

https:localhost:8180/1.sample?dest-dn=username.container&attr-name=Telephone%20Number&value=555-1212

Replace username.container with the DN of a user in your tree.