September 2015
Intermediate to advanced
206 pages
4h 45m
English
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.
StartupRunner.java under the src/main/java/org/test/bookpub/ directory from the root of our project with the following content:package org.test.bookpub; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.boot.CommandLineRunner; public class StartupRunner ...
Read now
Unlock full access