It is as simple as this:
@EventListener(ApplicationReadyEvent.class)
public void doSomethingAfterStartup() {
System.out.println("hello world, I have just started up");
}
Tested on version 1.5.1.RELEASE
More Related Contents:
- How to configure port for a Spring Boot application
- What is this spring.jpa.open-in-view=true property in Spring Boot?
- Spring Boot REST service exception handling
- How to hot-reload properties in Java EE and Spring Boot?
- Spring Boot Multiple Datasource
- After Spring Boot 2.0 migration: jdbcUrl is required with driverClassName
- CORS allowed-origin restrictions aren’t causing the server to reject requests
- How do I configure HikariCP in my Spring Boot app in my application.properties files?
- exclude @Component from @ComponentScan
- Programmatically shut down Spring Boot application
- How to bind an object list with thymeleaf?
- Setting active profile and config location from command line in spring boot
- What is the difference between putting a property on application.yml or bootstrap.yml in spring boot?
- Configure active profile in SpringBoot via Maven
- HttpSecurity, WebSecurity and AuthenticationManagerBuilder
- Maven spring boot run debug with arguments
- package org.springframework.boot does not exist
- Configure DataSource programmatically in Spring Boot
- What is the default scheduler pool size in spring-boot?
- Spring Security 5 : There is no PasswordEncoder mapped for the id “null”
- How to exclude *AutoConfiguration classes in Spring Boot JUnit tests?
- Difference between Interceptor and Filter in Spring MVC
- Spring Boot, logback and logging.config property
- Encoded password does not look like BCrypt
- Can I negate (!) a collection of spring profiles?
- Adding Dynamic Number of Listeners(Spring JMS)
- Best way of handling entities inheritance in Spring Data JPA
- Jackson date-format for OffsetDateTime in Spring Boot
- Using @RequestParam for multipartfile is a right way?
- Disabling a filter for only a few paths