Programmer DD
Programmer DD
May 30, 2022 · Backend Development

Master Spring Boot Startup: From static blocks to @PostConstruct and Runner Interfaces

This article explains the various ways to execute code during a Spring Boot application's startup, comparing Java static blocks, constructors, @PostConstruct methods, and Spring's ApplicationRunner and CommandLineRunner interfaces, including ordering with @Order and providing sample code and execution results.

ApplicationRunnerBackend DevelopmentCommandLineRunner
0 likes · 5 min read
Master Spring Boot Startup: From static blocks to @PostConstruct and Runner Interfaces
Code Ape Tech Column
Code Ape Tech Column
Nov 19, 2020 · Backend Development

Demystifying Spring Boot Startup: A Deep Dive into SpringApplication.run()

This article provides a step‑by‑step technical analysis of Spring Boot's startup process, breaking down the creation of SpringApplication, the configuration of application type, initializers, listeners, and the eight phases executed by the run() method, complete with code snippets and diagrams.

Backend DevelopmentJavaSpring Boot
0 likes · 16 min read
Demystifying Spring Boot Startup: A Deep Dive into SpringApplication.run()
Programmer DD
Programmer DD
Jan 4, 2020 · Backend Development

Mastering Spring Boot Startup: CommandLineRunner, ApplicationRunner, Listeners & More

This article explains the five ways Spring Boot can execute code during application startup—including CommandLineRunner, ApplicationRunner, ApplicationListener, @PostConstruct, and InitializingBean—detailing their usage, ordering, argument parsing, and best‑practice recommendations.

ApplicationListenerApplicationRunnerCommandLineRunner
0 likes · 12 min read
Mastering Spring Boot Startup: CommandLineRunner, ApplicationRunner, Listeners & More