diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2012-08-31 16:09:49 +0300 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2012-09-03 11:46:36 +0300 |
commit | 456f2c782658650ad2934b4ab614a971bad1634c (patch) | |
tree | 9d8e2277b03c45840492c8f1fb5182deb10edfb0 /server/src/com/vaadin/navigator | |
parent | f85c152a48686a8a0dca38ca12b4f3509cac056f (diff) | |
download | vaadin-framework-456f2c782658650ad2934b4ab614a971bad1634c.tar.gz vaadin-framework-456f2c782658650ad2934b4ab614a971bad1634c.zip |
Use hashbang (#!) URIs in Navigator; isEmpty() instead of equals("") (#9268, #9441)
Diffstat (limited to 'server/src/com/vaadin/navigator')
-rw-r--r-- | server/src/com/vaadin/navigator/Navigator.java | 11 |
1 files changed, 8 insertions, 3 deletions
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())) { |