diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2011-01-18 11:40:50 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2011-01-18 11:40:50 +0000 |
commit | 4e1a5db861e9e73e69fd492a55f171625f255beb (patch) | |
tree | ea0ab65327219cba3360354bd70456c571465bb6 | |
parent | 5759c381274ec38ae6039f539f3ce8906e940742 (diff) | |
download | vaadin-framework-4e1a5db861e9e73e69fd492a55f171625f255beb.tar.gz vaadin-framework-4e1a5db861e9e73e69fd492a55f171625f255beb.zip |
fixes #6301
svn changeset:16921/svn branch:6.5
-rw-r--r-- | src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index 5291870390..0808bd9125 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -1691,23 +1691,38 @@ public abstract class AbstractCommunicationManager implements // Get the path from URL String path = callback.getRequestPathInfo(request); - // If the path is specified, create name from it - if (path != null && path.length() > 0 && !path.equals("/")) { - String windowUrlName = null; - if (path.charAt(0) == '/') { - path = path.substring(1); - } - final int index = path.indexOf('/'); - if (index < 0) { - windowUrlName = path; - path = ""; - } else { - windowUrlName = path.substring(0, index); - path = path.substring(index + 1); - } + /* + * If the path is specified, create name from it. + * + * An exception is if UIDL request have come this far. This happens + * if main window is refreshed. In that case we always return main + * window (infamous hacky support for refreshes if only main window + * is used). However we are not returning with main window here (we + * will later if things work right), because the code is so cryptic + * that nobody really knows what it does. + */ + boolean pathMayContainWindowName = path != null + && path.length() > 0 && !path.equals("/"); + if (pathMayContainWindowName) { + boolean uidlRequest = path.startsWith("/UIDL"); + if (!uidlRequest) { + String windowUrlName = null; + if (path.charAt(0) == '/') { + path = path.substring(1); + } + final int index = path.indexOf('/'); + if (index < 0) { + windowUrlName = path; + path = ""; + } else { + windowUrlName = path.substring(0, index); + path = path.substring(index + 1); + } - window = application.getWindow(windowUrlName); + window = application.getWindow(windowUrlName); + } } + } // By default, use mainwindow |