Class VersionServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.apache.juneau.rest.server.servlet.RestServlet
org.apache.juneau.rest.server.convention.VersionServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable
Standalone servlet companion of the
VersionMixin mixin.
Mounts as a sibling top-level servlet at /version/* and serves the same
deployment-introspection JSON map as the mixin by delegating to a shared flavor-neutral
VersionProvider worker bean — so the two forms cannot drift.
Whereas the VersionMixin mixin pins its op at /version for composition
into a host at /, this companion declares the mount at the class level
(@Rest(paths="/version/*")) and pins the op at /*.
Microservice registration:
See Also:
- Since:
- 10.0.0
-
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
ConstructorsModifierConstructorDescriptionNo-arg constructor — uses a defaultVersionProviderworker.protectedVersionServlet(VersionProvider worker) Worker constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidgetInfo(RestResponse res) [GET /*] — emit the assembled metadata as a JSON map.Methods 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
-
VersionServlet
public VersionServlet()No-arg constructor — uses a defaultVersionProviderworker. -
VersionServlet
Worker constructor.- Parameters:
worker- The shared flavor-neutral version worker this servlet delegates to. Must not benull.
-
-
Method Details
-
getInfo
[GET /*] — emit the assembled metadata as a JSON map.- Parameters:
res- The current REST response.- Throws:
IOException- If an I/O error occurs while writing the response.
-