Package org.apache.juneau.rest.server.convention


package org.apache.juneau.rest.server.convention
Convention-endpoints mixin pack — composable @Rest(mixins=...) resources that ship the "internet conventions" surface (favicon, robots, sitemap, version, well-known) every public-facing service eventually grows.

Four sibling mixins compose into the host @Rest-annotated resource. Each mixin owns its default mount paths and is independently mountable; the four together drop in as a pack via @Rest(mixins={FaviconMixin.class, SeoMixin.class, VersionMixin.class, WellKnownMixin.class}).

  • FaviconMixin — /favicon.ico with a 30-day Cache-Control and a default Juneau-branded icon on the framework classpath.
  • SeoMixin — /robots.txt (deny-all by default) and /sitemap.xml (empty <urlset> by default); both builder-driven.
  • VersionMixin — /version (SVL-configurable) returning a JSON metadata map; defaults read MANIFEST.MF + git.properties from the classpath.
  • WellKnownMixin — /.well-known/security.txt per RFC 9116; 404 unless explicitly configured.
Composition example:

@Rest( path="/api", mixins={ FaviconMixin.class, SeoMixin.class, VersionMixin.class, WellKnownMixin.class } ) public class ApiResource extends RestServlet { @Bean SeoMixin seo() { return SeoMixin.create().robotsAllow("*", "/").build(); } @Bean WellKnownMixin wellKnown() { return WellKnownMixin.create() .securityTxt("Contact: security@example.com\nExpires: 2027-01-01T00:00:00Z\n") .build(); } }

All four endpoints are excluded from generated Swagger / OpenAPI specs via @OpSwagger(ignore=true) — convention endpoints are not API-meaningful.

See Also:
Since:
10.0.0