Class App
java.lang.Object
org.apache.juneau.microservice.springboot.template.App
Entry point for Examples REST application when deployed as a Spring Boot application.
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptionally return an injectable message provider for theHelloWorldResource
class.Optionally return theHelloWorldResource
object as an injectable bean.Our root REST bean.org.springframework.boot.web.servlet.ServletRegistrationBean<jakarta.servlet.Servlet>
getRootServlet
(RootResources rootResources) static void
Entry point method.org.springframework.boot.web.servlet.FilterRegistrationBean<org.springframework.web.filter.HiddenHttpMethodFilter>
registration
(org.springframework.web.filter.HiddenHttpMethodFilter filter) We want to be able to consume url-encoded-form-post bodies, but HiddenHttpMethodFilter triggers the HTTP body to be consumed.
-
Constructor Details
-
App
public App()
-
-
Method Details
-
main
Entry point method.- Parameters:
args
- Command-line arguments.
-
getRootResources
Our root REST bean.Note that this must extend from
SpringRestServlet
so that child resources can be resolved as Spring beans.All REST objects are attached to this bean using the
Rest.children()
annotation.- Returns:
- The root resources REST bean.
-
getHelloWorldResource
Optionally return theHelloWorldResource
object as an injectable bean.- Returns:
- The hello-world REST bean.
-
getHelloWorldMessageProvider
Optionally return an injectable message provider for theHelloWorldResource
class.- Returns:
- The message provider for the hello-world REST bean.
-
getRootServlet
@Bean public org.springframework.boot.web.servlet.ServletRegistrationBean<jakarta.servlet.Servlet> getRootServlet(RootResources rootResources) - Parameters:
rootResources
- The root REST resource servlet- Returns:
- The servlet registration mapped to "/*".
-
registration
@Bean public org.springframework.boot.web.servlet.FilterRegistrationBean<org.springframework.web.filter.HiddenHttpMethodFilter> registration(org.springframework.web.filter.HiddenHttpMethodFilter filter) We want to be able to consume url-encoded-form-post bodies, but HiddenHttpMethodFilter triggers the HTTP body to be consumed. So disable it.- Parameters:
filter
- The filter.- Returns:
- Filter registration bean.
-