@Override public void onValueChange(final ValueChangeEvent<String> event) { HistoryToken token = null; try { logger.debug("URL value changed to " + event.getValue()); if (needsApplicationContext()) { final String context = inferAppContext(event.getValue()); logger.info("No application context defined. Inferring application context as " + context + ". Change this value by setting the variable \"erraiApplicationWebContext\" in your GWT host page" + ", or calling Navigation.setAppContext."); setAppContext(context); } token = historyTokenFactory.parseURL(event.getValue()); if (currentPage == null || !token.equals(currentPageToken)) { final PageNode<IsWidget> toPage = navGraph.getPage(token.getPageName()); navigate(new Request<>(toPage, token), false); } } catch (final Exception e) { if (token == null) navigationErrorHandler.handleInvalidURLError(e, event.getValue()); else navigationErrorHandler.handleInvalidPageNameError(e, token.getPageName()); } } });
@Override public void onValueChange(final ValueChangeEvent<String> event) { HistoryToken token = null; try { logger.debug("URL value changed to " + event.getValue()); if (needsApplicationContext()) { final String context = inferAppContext(event.getValue()); logger.info("No application context defined. Inferring application context as " + context + ". Change this value by setting the variable \"erraiApplicationWebContext\" in your GWT host page" + ", or calling Navigation.setAppContext."); setAppContext(context); } token = historyTokenFactory.parseURL(event.getValue()); if (currentPage == null || !token.equals(currentPageToken)) { final PageNode<IsWidget> toPage = navGraph.getPage(token.getPageName()); navigate(new Request<>(toPage, token), false); } } catch (final Exception e) { if (token == null) navigationErrorHandler.handleInvalidURLError(e, event.getValue()); else navigationErrorHandler.handleInvalidPageNameError(e, token.getPageName()); } } });