diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-09-24 16:31:08 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-09-24 16:36:07 +0300 |
commit | 5f0952f60ed9d5b41a761ef0cd56c3ddc596d2b2 (patch) | |
tree | 20ad3bbd2c06d5f3890d3ea12c1ac1f7c04eb9a6 | |
parent | 3adc8aa1a83e8f47c1195354c87c5caf78ccb905 (diff) | |
download | vaadin-framework-5f0952f60ed9d5b41a761ef0cd56c3ddc596d2b2.tar.gz vaadin-framework-5f0952f60ed9d5b41a761ef0cd56c3ddc596d2b2.zip |
Only use UI from web.xml for requests without additional path (#9722)
-rw-r--r-- | WebContent/VAADIN/vaadinBootstrap.js | 5 | ||||
-rw-r--r-- | server/src/com/vaadin/server/DefaultUIProvider.java | 7 | ||||
-rw-r--r-- | server/src/com/vaadin/server/VaadinServlet.java | 4 |
3 files changed, 14 insertions, 2 deletions
diff --git a/WebContent/VAADIN/vaadinBootstrap.js b/WebContent/VAADIN/vaadinBootstrap.js index 36cf2ec8eb..c8a2c03545 100644 --- a/WebContent/VAADIN/vaadinBootstrap.js +++ b/WebContent/VAADIN/vaadinBootstrap.js @@ -106,7 +106,10 @@ url += "&rootId=" + rootId; } - url += '&initialPath=' + encodeURIComponent(getConfig("initialPath")); + var initialPath = getConfig("initialPath"); + if (initialPath === null) { + url += '&initialPath=' + encodeURIComponent(initialPath); + } url += '&initialParams=' + encodeURIComponent(JSON.stringify(getConfig("initialParams"))); url += '&' + vaadin.getBrowserDetailsParameters(appId); diff --git a/server/src/com/vaadin/server/DefaultUIProvider.java b/server/src/com/vaadin/server/DefaultUIProvider.java index 5ca479cc6d..7262249d7b 100644 --- a/server/src/com/vaadin/server/DefaultUIProvider.java +++ b/server/src/com/vaadin/server/DefaultUIProvider.java @@ -23,6 +23,13 @@ public class DefaultUIProvider extends UIProvider { @Override public Class<? extends UI> getUIClass(UIClassSelectionEvent event) { VaadinRequest request = event.getRequest(); + + // Only use UI from web.xml for requests to the root + String pathInfo = request.getRequestPathInfo(); + if (pathInfo != null && !"/".equals(pathInfo)) { + return null; + } + Object uiClassNameObj = request.getVaadinService() .getDeploymentConfiguration().getInitParameters() .getProperty(VaadinSession.UI_PARAMETER); diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java index c8f85020d5..ac8643bcaa 100644 --- a/server/src/com/vaadin/server/VaadinServlet.java +++ b/server/src/com/vaadin/server/VaadinServlet.java @@ -303,7 +303,9 @@ public class VaadinServlet extends HttpServlet implements Constants { if (communicationManager.handleOtherRequest(request, response)) { return; } - // TODO Should return 404 error here and not do anything more + + // Request not handled by any RequestHandler -> 404 + response.sendError(HttpServletResponse.SC_NOT_FOUND); } catch (final SessionExpiredException e) { // Session has expired, notify user |