From: Johannes Dahlström Date: Fri, 31 Aug 2012 13:09:49 +0000 (+0300) Subject: Use hashbang (#!) URIs in Navigator; isEmpty() instead of equals("") (#9268, #9441) X-Git-Tag: 7.0.0.beta1~206^2~9 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=456f2c782658650ad2934b4ab614a971bad1634c;p=vaadin-framework.git Use hashbang (#!) URIs in Navigator; isEmpty() instead of equals("") (#9268, #9441) --- diff --git a/server/src/com/vaadin/navigator/Navigator.java b/server/src/com/vaadin/navigator/Navigator.java index bda422379c..e2e40ea732 100644 --- a/server/src/com/vaadin/navigator/Navigator.java +++ b/server/src/com/vaadin/navigator/Navigator.java @@ -108,12 +108,17 @@ public class Navigator implements Serializable { @Override public String getState() { - return page.getFragment(); + String fragment = page.getFragment(); + if (fragment.startsWith("!")) { + return page.getFragment().substring(1); + } else { + return ""; + } } @Override public void setState(String state) { - page.setFragment(state, false); + page.setFragment("!" + state, false); } @Override @@ -475,7 +480,7 @@ public class Navigator implements Serializable { if (null != viewName && getStateManager() != null) { String navigationState = viewName; - if (!parameters.equals("")) { + if (!parameters.isEmpty()) { navigationState += "/" + parameters; } if (!navigationState.equals(getStateManager().getState())) {