Spring Boot | Tutorial 6: Runners (Command Line Runner, Application Runner)

  • whats spring boot runner?
  • It is functional interface. Spring boot will call this automatically.
  • commandline runner and application runner?
  • commandline runner : takes args, application runner : app argu object with more control
  • why we need runner - once we initialized a container, we dont have control in spring boot.
  • when to use
  • 1. implementing commandlinerunner with Application class
  • calls application runner first, and commandline runner
  • 2. we can create another class and implement CommandLineRunner, and use @Bean annotation, and it will get Runner instance.
  • 3. Declare Runner as a Component. When scanning, spring boot will detect @component definition, and will call overwritten run method.

MEKA

Composed 191 Viments

18

Published on Nov 15, 2020

Send Viment

Comments 0

Viments for this video by others

There's no pre-existing Viments

Facebook Kakao Naver Twitter

Embed

Copy & Paste following HTML

Viment Text

Copy & Paste following Text