Class RootResources

All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable, BasicUniversalConfig, DefaultConfig, DefaultHtmlConfig

Root router resource for the Jetty deployment.

Mounts the deployment-agnostic PetStoreResource and PetstoreConsoleResource (the admin console at /console) from juneau-petstore-core, and the Jetty/Microservice-specific admin resources (ConfigResource, LogsResource, ShutdownResource). The admin trio is a documented Jetty-only non-parity feature — the Spring Boot deployment in juneau-petstore-springboot does not mount it. App.AppConfig.adminBoundary() puts the trio behind its own CSRF boundary.

Also showcases the Config API + SVL variable resolver: the root page's header is driven by $C{Petstore/appName}, which resolves against the [Petstore] section of juneau-petstore-jetty.cfg (the same $C{...} pattern already used by the source navlink below, which resolves $C{Source/gitHub}). Jetty-only — Spring Boot's embedded container has no .cfg/Config equivalent.

Registers the one seeded PetStore shared by every child resource.

Example:

// Children declare a field and the group's bean back-fills it. @Bean private transient PetStore store;

See Also:
  • Constructor Details

  • Method Details

    • petStore

      public PetStore petStore()
      Registers the one PetStore shared by the /petstore API and the console tree, seeded with the deterministic demo data set.

      Child resources inherit the group's beans, so a plain @Bean method is all that is needed.

      The store runs on the system clock unless the "PETSTORE_FIXED_NOW" environment variable is set, which pins "now" so the store page's day figures render the same on every run (the docs screenshots rely on this). Its value is an ISO-8601 instant such as 2026-10-01T12:00:00Z, or seed for the seed data's own clock.

      Returns:
      The seeded PetStore.
    • index

      public SeeOther index(RestRequest req)
      GET / goes to the console store page.
      Parameters:
      req - The request.
      Returns:
      A 303 to /console/store.