> Markdown version of [Spring Events](https://vaadin.com/docs/latest/flow/integrations/spring/events). Section index: [llms.txt](https://vaadin.com/docs/latest/flow/llms.txt)

# Spring Events

The Spring integration publishes events to the application context. You don’t need to register a listener. It’s sufficient to handle these events using only the `@EventListener` annotation.

Events published to the Spring application context include:

- `ServiceInitEvent`

  See [VaadinServiceInitListener](https://vaadin.com/docs/latest/flow/advanced/service-init-listener.md) for details.

The example here uses the `@EventListener` annotation to listen to the `ServiceInitEvent` event:

```java
@SpringComponent
public class BootstrapCustomizer {

    @EventListener
    private void onServiceInit(ServiceInitEvent serviceInitEvent) {
        serviceInitEvent.addIndexHtmlRequestListener(
                this::modifyBootstrapPage);
    }

    private void modifyBootstrapPage(
            IndexHtmlResponse response) {
        response.getDocument().body().append(
                "<p>By Spring EventListener</p>");
    }
}
```
