Class UnsupportedBrowserEvent

java.lang.Object
java.util.EventObject
com.vaadin.flow.server.UnsupportedBrowserEvent
All Implemented Interfaces:
Serializable

public class UnsupportedBrowserEvent extends EventObject
Event fired through the service event bus when a browser is shown the page telling that it is too old to run the application, just before the page is written to the response.

The bootstrap page detects a browser that lacks features the application needs and redirects it to that page, so the event is fired on the request thread of the redirected request. A browser too old to run the detection script at all never makes that request, and no event is fired for it.

Listen to the event to, for example, record which users run an outdated browser:

 service.getEventBus().addListener(UnsupportedBrowserEvent.class,
         event -> log(event.getRequest().getHeader("User-Agent")));
 
See Also:
  • Constructor Details

    • UnsupportedBrowserEvent

      public UnsupportedBrowserEvent(VaadinService service, VaadinSession session, VaadinRequest request)
      Creates a new event.
      Parameters:
      service - the service that handles the request, not null
      session - the session of the browser, not null
      request - the request for the page, not null
  • Method Details

    • getService

      public VaadinService getService()
      Gets the service that handles the request.
      Returns:
      the service, not null
    • getSession

      public VaadinSession getSession()
      Gets the session of the browser.
      Returns:
      the session, not null
    • getRequest

      public VaadinRequest getRequest()
      Gets the request for the page. The User-Agent header of the request tells which browser it is.
      Returns:
      the request, not null