This example demonstrates Hello World and Counter examples with CDI 2 SE implemented by Weld.
The mapping of the URI path space is presented in the following table:
| URI path | Resource class | HTTP methods | Notes | 
|---|---|---|---|
| /helloworld/{name} | HelloWorldResource | GET | Returns Hello {name} | 
| /counter/request | CounterResource | GET | Returns always 1(injected always a new instance of counter) | 
| /counter/application | CounterResource | GET | Returns an incremented number (injected always the same counter). | 
Run the example as follows:
mvn clean compile exec:java
This deploys the example using Grizzly container.