java.lang.Object
org.apache.juneau.petstore.springboot.App

@SpringBootApplication @Controller public class App extends Object
Petstore Spring Boot deployment entry point.

Boots a Spring Boot embedded servlet container, wires RootResources as a Spring bean, and mounts it at /* via ServletRegistrationBean.

Provides a @Bean HelloMessageProvider to demonstrate Spring @Autowired injection into the companion HelloResource child — preserving the deployment-glue Spring-injection demo.

See Also:
  • Constructor Details

    • App

      public App()
  • Method Details

    • main

      public static void main(String[] args)
      Entry point.
      Parameters:
      args - Command-line arguments forwarded to Spring Boot.
    • helloMessageProvider

      Spring-injected message provider consumed by HelloResource.
      Returns:
      The hello-message provider bean.
    • helloResource

      @Bean public HelloResource helloResource(HelloMessageProvider helloMessageProvider)
      Returns HelloResource as a Spring bean with its dependency injected via constructor.
      Parameters:
      helloMessageProvider - The Spring-managed message provider bean.
      Returns:
      The hello-world REST resource.
    • rootResources

      @Bean public RootResources rootResources()
      Returns the root router as a Spring bean so child resources resolve as Spring beans.
      Returns:
      The root router REST resource.
    • consoleBoundary

      @Bean public org.springframework.boot.web.servlet.FilterRegistrationBean<PetstoreConsoleBoundary> consoleBoundary()
      Registers the console's CSRF boundary on /console/*.

      The /petstore API is covered by apiBoundary(); /petstore-ui is outside both. See PetstoreConsoleBoundary. The console boundary is built over the same PetstoreApiBoundary the API registration mounts, so the API token its pages carry is one the API filter accepts.

      The filter runs on forwarded, async and error dispatches as well as on the original request, so a dispatch that lands on a console path is checked too.

      Returns:
      The filter registration.
    • apiBoundary

      @Bean public org.springframework.boot.web.servlet.FilterRegistrationBean<PetstoreApiBoundary> apiBoundary()
      Registers the API's CSRF boundary on /petstore/*.

      It runs only on the original request: an internal forward or error dispatch to the API is not a new attacker-controlled request. The order keeps it just behind the console boundary; the two patterns never overlap.

      Returns:
      The filter registration.
    • rootServlet

      @Bean public org.springframework.boot.web.servlet.ServletRegistrationBean<jakarta.servlet.Servlet> rootServlet(RootResources rootResources)
      Mounts the root router servlet at /*.
      Parameters:
      rootResources - The Spring-managed root router.
      Returns:
      The servlet registration mapped to /*.