Class JuneauServletRegistrations
ServletRegistrationBean whose
URL mappings are derived from a Juneau servlet's self-declared top-level paths.
Use this from an explicit @Bean method when you want the mount path to come from the
servlet's own @Rest(paths) declaration
(or its getPaths() override) rather than a hard-coded string in your configuration class:
The mapping is resolved via
RestContext.resolveTopLevelPaths(...)
— the same runtime-override resolution chain the Jetty microservice auto-discovery loop and
the Spring Boot auto-configuration use — so behavior is identical across runtimes. No path
string is hard-coded here; a servlet that resolves to no top-level paths is rejected with an
IllegalArgumentException (declare @Rest(paths=...) or override getPaths()).
See Also:
- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends jakarta.servlet.Servlet>
org.springframework.boot.web.servlet.ServletRegistrationBean<T>forServlet(T servlet, BeanStore beanStore) Builds aServletRegistrationBeanfor the supplied Juneau servlet, mapping it at the top-level paths it self-declares.
-
Method Details
-
forServlet
public static <T extends jakarta.servlet.Servlet> org.springframework.boot.web.servlet.ServletRegistrationBean<T> forServlet(T servlet, BeanStore beanStore) Builds aServletRegistrationBeanfor the supplied Juneau servlet, mapping it at the top-level paths it self-declares.- Type Parameters:
T- The servlet type.- Parameters:
servlet- The Juneau REST servlet to register. Must not benulland must carry a@Restannotation that resolves to at least one top-level path (viapaths()or agetPaths()override).beanStore- The bean store used for SVL resolution of@Rest(paths)elements (e.g.$C{key}/${env}templates). May benull(SVL is then skipped; literal paths pass through unchanged).- Returns:
- A registration bean mapping the servlet at its self-declared paths.
- Throws:
IllegalArgumentException- Ifservletisnullor resolves to no top-level paths.
-