Demo Home
Demo Web Application Only - Do NOT Deploy in Production

JNDI Test WebApp

This example shows how to configure and lookup resources such as DataSources, a JTA transaction manager and a java.mail.Session in JNDI.

Preparation

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.

Execution

Click Test to check the runtime lookup of the JNDI resources.