Key

This line was added.

This line was removed.

Formatting was changed.

...

To use injections and callbacks declared in web.xml, you simply follow the instructions for setting up JNDI. Once your webapp is configured for JNDI access (ie you have followed the instructions in the first section of the JNDI page), and you have defined the resources you want to access in a jetty configuration file (such as a jetty.xml or a WEB-INF/jetty-env.xml file as described on the JNDI page), you can reference them in your web.xml file.

Example Web Application

The examples/test-jndi-webapp webapp in the Jetty distribution shows you how to go about this.

...

Once you've enabled annotation support for your webapp, and followed the instructions in JNDI to set up references to resources you want to access at runtime (eg org.mortbay.jetty.plus.naming.EnvEntry for environment values, org.mortbay.jetty.plus.naming.Resource for DataSources, Queues, Topics etc) you can go ahead a mark up your code.

Example Web Application

The examples/test-annotations web application can be built and deployed to demonstrate how to use annotation markup in your code.

Contact the core Jetty developers at
www.webtide.com
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ...
scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery