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
Here's an example application that sets up a Jetty server, does some setup to ensure that annotations are scanned and deploys a webapp that uses annotations. This example also uses the @Resource annotation which involves JNDI, so we would also add the necessary jndi jars to the classpath., and we also add in the configuration classes that are responsible for JNDI (see line 19).
Here is the embedding code:
On line 19 we add in the configuration classes responsible for setting up JNDI and java:comp/env.
On line 20 we add in the configuration class that ensures annotations are inspected.
On lines 30, 33 and 37 we set up some JNDI resources that we will be able to reference with @Resource annotations.
With the setup above, we can create a servlet that uses annotations and Jetty will honour the annotations when the webapp is deployed: