use of com.vaadin.flow.router.internal.ResolveRequest in project flow by vaadin.
the class Router method handleNavigation.
private int handleNavigation(UI ui, Location location, NavigationTrigger trigger) {
NavigationState newState = getRouteResolver().resolve(new ResolveRequest(this, location));
if (newState != null) {
NavigationEvent navigationEvent = new NavigationEvent(this, location, ui, trigger);
NavigationHandler handler = new NavigationStateRenderer(newState);
return handler.handle(navigationEvent);
} else if (!location.getPath().isEmpty()) {
Location slashToggledLocation = location.toggleTrailingSlash();
NavigationState slashToggledState = getRouteResolver().resolve(new ResolveRequest(this, slashToggledLocation));
if (slashToggledState != null) {
NavigationEvent navigationEvent = new NavigationEvent(this, slashToggledLocation, ui, trigger);
NavigationHandler handler = new InternalRedirectHandler(slashToggledLocation);
return handler.handle(navigationEvent);
}
}
throw new NotFoundException("Couldn't find route for '" + location.getPath() + "'");
}
Aggregations