Class RootResources
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable,BasicUniversalConfig,DefaultConfig,DefaultHtmlConfig
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:
See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.juneau.rest.server.servlet.RestServlet
RestServlet.Builder<R extends RestServlet,SELF extends RestServlet.Builder<R, SELF>>, RestServlet.DefaultBuilder<R extends RestServlet> -
Field Summary
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.juneau.rest.server.servlet.BasicRestServletGroup
addChild, addChild, addChild, getChildResources, removeChild, removeChildMethods inherited from class org.apache.juneau.rest.server.servlet.RestServlet
builder, createAuthenticator, destroy, doLog, getContext, getPath, getPaths, getRequest, getResponse, getRestBuilder, init, log, log, service, setContextMethods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPatch, doPost, doPut, doTrace, getLastModified, isSensitiveHeader, serviceMethods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
RootResources
public RootResources()
-
-
Method Details
-
petStore
Registers the onePetStoreshared by the/petstoreAPI and the console tree, seeded with the deterministic demo data set.Child resources inherit the group's beans, so a plain
@Beanmethod 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, orseedfor the seed data's own clock.- Returns:
- The seeded
PetStore.
-
index
GET /goes to the console store page.- Parameters:
req- The request.- Returns:
- A 303 to
/console/store.
-