This example demonstrates the usage of Java 8's new constructs and types.
Currently demonstrated are:
The mapping of the URI path space is presented in the following table:
| URI path | Resource class | HTTP method | description | 
|---|---|---|---|
| /j8/default-method | DefaultMethodInterface | GET | returns interface-rootintext/plain | 
| /j8/default-method/path | DefaultMethodInterface | GET | returns interface-pathintext/plain | 
| /j8/default-method/class | DefaultMethodResource | GET | returns classintext/plain | 
| /j8/lambdas/{p} | LambdaResource | GET | returns {p}-lambdaizedintext/plain | 
Application is Servlet 3 based, web.xml-less. Everything needed (resources/providers) is registered in the Java8Application class.
Run the example as follows:
mvn clean package jetty:run
This deploys current example using Jetty. You can access the application at: