Home

Test 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 edit the start.ini or start.d/*.ini files to include "OPTIONS=jndi".

For the jetty distribution demos, jndi is already enabled in the start.d/900-demo.ini file and also enables the jndi.demo option which includes some mock resources used by the test.

The full source of this demonstration is available here.

Execution

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