This example demonstrates how to develop RESTful web service with JCDI managed beans and a Servlet 3.0 Web container.
This example currently works only with a standalone GlassFish 3.1.x instance. The easiest way to get the application running is to use the GlassFish Update Center client, install "Jersey examples and documentation" IPS module from there and follow instructions at the module README file in order to deploy the example. If you have already installed from the Update Center, the module readme file should be accessible here
After you successfully deploy the application, visit the following URLs:
Description URL Expected Results A managed bean with no use of injection whatsoever http://localhost:8080/jersey-cdi/helloworldHello WorldShows injection of context objects into the fields of a managed bean. http://localhost:8080/jersey-cdi/simpleOK GET http://localhost:8080/jersey-cdi/simpleShows injection of context objects and path parameters into the fields of a managed bean. http://localhost:8080/jersey-cdi/other/c/dOTHER c dShows constructor injection of a path parameter in a managed bean. http://localhost:8080/jersey-cdi/echoconstructor/aECHO aShows injection of path and query parameters into the fields of a managed bean. http://localhost:8080/jersey-cdi/echofield/bECHO null bA managed bean that uses (but does not inject) a path parameter. http://localhost:8080/jersey-cdi/echo/aECHO aShows injection of context objects into the fields of a EJB Stateless Session bean. http://localhost:8080/jersey-cdi/ejb/stateless1Shows injection of query parameters into the fields of a managed bean. http://localhost:8080/jersey-cdi/jcdibean/per-requestnull1Shows injection of context objects into the fields of a managed bean. http://localhost:8080/jersey-cdi/jcdibean/singleton1Shows injection of context objects and query parameters into the fields of a managed bean. http://localhost:8080/jersey-cdi/jcdibean/dependent/per-requestnull1Shows injection of context objects into the fields of a managed bean. http://localhost:8080/jersey-cdi/jcdibean/dependent/singleton1