This example shows how to configure and lookup resources such as DataSources, a JTA transaction manager and a java.mail.Session in JNDI.
To enable JNDI in a base jetty instance do:
$ cd $JETTY_BASE $ java -jar $JETTY_HOME/start.jar --add-module=jndi
This will create a $JETTY_BASE/start.d/jndi.ini
file to enable and parameterise JNDI.
The jetty demo-base already has JNDI enabled and some mock resources included by the
demo-jndi module.
The full source of this demonstration is available here.
Click Test
to check the runtime lookup of the JNDI resources.