Jetty Logo
Version: 9.2.3.v20140905
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

Using JNDI with Jetty Embedded

Setting up the Classpath
Example Code

Setting up the Classpath

In addition to the jars that you require for your application, and the jars needed for core Jetty, you will need to place the following jars onto your classpath:

If you are using transactions, you will also need the javax.transaction api. You can obtain this jar from the Jetty dependencies site.

If you wish to use mail, you will also need the javax.mail api and implementation. You can obtain this jar from the Jetty dependencies site. Note that this jar also requires the javax.activation classes, which you can also obtain from the Jetty dependencies site.

Example Code

Here is an example class that sets up some JNDI entries and deploys a webapp that references these JNDI entries in code. We'll use some mocked up classes for the transaction manager and the DataSource in this example for simplicity:

See an error or something missing? Contribute to this documentation at Github!(Generated: 2014-11-23T01:00:25-08:00)