Class BasicRestServletGroup

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable, BasicUniversalConfig, DefaultConfig, DefaultHtmlConfig
Direct Known Subclasses:
BasicActuatorGroup, RootResources, SampleRootResource

public abstract class BasicRestServletGroup extends BasicRestServlet
Specialized subclass of BasicRestServlet for showing "group" pages.

Meant as a base class for top-level REST resources in servlet containers.

Provides support for JSON, XML, HTML, URL-Encoding, UON, XML, OpenAPI, and MessagePack. See BasicUniversalConfig for details.

Adds the group-navigation endpoint (GET /) by composing NavigationMixin via @Rest(mixins=...) on top of the residual op-mixins inherited from BasicRestServlet. The navigation op lives on the NavigationMixin sub-context (backed by RestMixin.getHostContext()) but renders with the host's @HtmlDocConfig page decoration — mixin sub-contexts inherit the host's class-level @HtmlDocConfig (and other class-level config), so the navigation page matches the host's other endpoints.

Children are attached to this resource using the @Rest(children) annotation.

Dynamic children:

Additional child resources can be registered or unregistered at runtime via addChild(Class) / removeChild(String) (and overloads). This is particularly useful in test fixtures where a single group servlet is mounted once and individual tests plug in their own @Rest resources without restarting the servlet container.

See Also: