Search code examples
javaservletsosgilotus-domino

Domino OSGi servlet <contextRoot>


When writing a Domino OSGi servlet you need to specify a context root for your web application. This is done in plugin.xml.

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         point="com.ibm.pvc.webcontainer.application">
      <contextRoot>
         /exporter
      </contextRoot>
      <contentLocation>
         WebContent
      </contentLocation>
   </extension>

</plugin>
  1. Does the context root need to be unique for all OSGi servlets running on the server?

  2. Where can I find documentation?


Solution

    1. Yes. Context root needs to be unique.

    2. I can't find any useful documentation on the com.ibm.pvc.webcontainer.application extension point. As I mentioned in the comments, I recommend you instead use the org.eclipse.equinox.http.registry.servlets extension point. That's how the DAS plugin implements a servlet (see the DAS plugin.xml). Both extension points are defined by OSGi plugins Domino inherited from elsewhere. That's why the Domino documentation doesn't cover them, but I think you will find more documentation on the equinox extension point. For example, see Paul Fiore's Domino OSGi Development slide deck. That includes a whole section on creating a servlet.