Serializable Service References for Vaadin Flow | Vaadin

Serializable Service References for Vaadin Flow

This mini add-on provides serializable service references. Supports Spring Boot and CDI.

What does this do and how does it work?

Vaadin stores all UIs in their respective HTTP session. If you want to be able to persist your sessions (so they survive a server restart or can be migrated to a different server), everything in these UIs needs to be serializable. While dependency injection provides easy and convenient access to your services, these services aren't and shouldn't be serializable. You could always use static methods to access your services, but you would lose the convenience of DI. This add-on solves this by injecting serializable service references instead of services directly.


Inject your service like this:

// Spring
private ServiceRef<MyService> myService;

// CDI
private ServiceRef<MyService> myService;

And then use it like this:



Link to this version
BetaReleased 19 April 2022Apache License 2.0
Framework Support
Vaadin platform 14+
Browser Independent
Install with
Release notes - Version 0.7.1

Fixed CDI implementation.