]> source.dussan.org Git - vaadin-framework.git/commitdiff
Use hashbang (#!) URIs in Navigator; isEmpty() instead of equals("") (#9268, #9441)
authorJohannes Dahlström <johannesd@vaadin.com>
Fri, 31 Aug 2012 13:09:49 +0000 (16:09 +0300)
committerJohannes Dahlström <johannesd@vaadin.com>
Mon, 3 Sep 2012 08:46:36 +0000 (11:46 +0300)
server/src/com/vaadin/navigator/Navigator.java

index bda422379cc69760000bc3d88ae04b90a36380aa..e2e40ea732cdf5260e8e2799db9ad0cc62751264 100644 (file)
@@ -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())) {