Skip to main content

Juneau REST Server

Annotate a POJO and serve it as REST in every format Juneau speaks.

import org.apache.juneau.http.*;
import org.apache.juneau.rest.server.*;
import org.apache.juneau.rest.server.servlet.*;

@Rest(path="/pets")
public class PetStore extends BasicRestServlet {

@RestGet("/{id}")
public Pet get(@Path("id") long id) {
return store.getPet(id);
}
}
  • Content negotiation across every Juneau format, from the request's Accept and Content-Type headers.
  • Generated OpenAPI and Swagger documentation for every resource.
  • Runs on Jetty, Tomcat or Spring Boot, or as a config-driven microservice.
  • Auth modules for JWT, OAuth, OIDC and SAML.
  • Metrics and tracing through Micrometer and OpenTelemetry.
  • Serverless tests with juneau-rest-mock.

Modules: juneau-rest-server, juneau-rest-common, juneau-microservice, juneau-microservice-jetty, juneau-microservice-tomcat, juneau-rest-server-springboot, juneau-rest-mock, juneau-rest-server-auth-jwt, juneau-rest-server-auth-oauth, juneau-rest-server-auth-oidc-rp, juneau-rest-server-auth-saml, juneau-rest-server-metrics-micrometer, juneau-rest-server-tracing-otel

Read more →