Package com.vaadin.flow.server
Class UnsupportedBrowserEvent
java.lang.Object
java.util.EventObject
com.vaadin.flow.server.UnsupportedBrowserEvent
- All Implemented Interfaces:
Serializable
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:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionUnsupportedBrowserEvent(VaadinService service, VaadinSession session, VaadinRequest request) Creates a new event. -
Method Summary
Modifier and TypeMethodDescriptionGets the request for the page.Gets the service that handles the request.Gets the session of the browser.Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
UnsupportedBrowserEvent
Creates a new event.- Parameters:
service- the service that handles the request, notnullsession- the session of the browser, notnullrequest- the request for the page, notnull
-
-
Method Details
-
getService
Gets the service that handles the request.- Returns:
- the service, not
null
-
getSession
Gets the session of the browser.- Returns:
- the session, not
null
-
getRequest
Gets the request for the page. TheUser-Agentheader of the request tells which browser it is.- Returns:
- the request, not
null
-