- Spring Boot 2.0 Cookbook(Second Edition)
- Alex Antonov
- 63字
- 2021-06-24 19:24:37
Using the command-line runners
With our basic application skeleton ready, let's add some meat to the bones by making our application do something.
Let's start by first creating a class named StartupRunner. This will implement the CommandLineRunner interface, which basically provides just one method: public void run(String... args) --that will get called by Spring Boot only once after the application has started.