From 456f2c782658650ad2934b4ab614a971bad1634c Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Fri, 31 Aug 2012 16:09:49 +0300 Subject: Use hashbang (#!) URIs in Navigator; isEmpty() instead of equals("") (#9268, #9441) --- server/src/com/vaadin/navigator/Navigator.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'server') 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())) { -- cgit v1.2.3