tree: b4a8ed2c75fef226e73b28b9b4a417a28f5f41f1 [path history] [tgz]
  1. src/
  2. pom.xml
  3. README.MD
examples/java8-webapp/README.MD

Jersey and Java 8 Examples Features and Types

This example demonstrates the usage of Java 8's new constructs and types.

Currently demonstrated are:

  • Default methods in interfaces - acting as JAX-RS Resource Methods

Contents

The mapping of the URI path space is presented in the following table:

URI pathResource classHTTP methoddescription
/j8/default-methodDefaultMethodInterfaceGETreturns interface-root in text/plain
/j8/default-method/pathDefaultMethodInterfaceGETreturns interface-path in text/plain
/j8/default-method/classDefaultMethodResourceGETreturns class in text/plain
/j8/lambdas/{p}LambdaResourceGETreturns {p}-lambdaized in text/plain

Application is Servlet 3 based, web.xml-less. Everything needed (resources/providers) is registered in the Java8Application class.

Running the Example

Run the example as follows:

mvn clean package jetty:run

This deploys current example using Jetty. You can access the application at: