flow-and-components-documentation icon indicating copy to clipboard operation
flow-and-components-documentation copied to clipboard

Missing docs: custom SessionInitListener with Vaadin-Spring

Open mvysny opened this issue 5 years ago • 1 comments
trafficstars

Would be good to have an example on how to register app-specific SessionInitListener when running Vaadin on Spring.

mvysny avatar Nov 23 '20 10:11 mvysny

You can use this:

@Component
public class CustomServiceInitListener implements VaadinServiceInitListener {
   @Override
   public void serviceInit(ServiceInitEvent event) {
      event.getSource().addSessionInitListener(event1 -> {
         // do something
      });
   }
}

jcgueriaud1 avatar Nov 23 '20 10:11 jcgueriaud1