From 51fef5e8cb39f96dac11f4b3e2d772525d3ebfe6 Mon Sep 17 00:00:00 2001 From: Taras Hupalo Date: Wed, 24 Sep 2014 12:10:46 +0300 Subject: Added support PORTLET_CONTEXT for vaadin.resources.path value (#14640) Change-Id: Ie801a17ed1eff29a7dc6be61755241777071ab8f --- server/src/com/vaadin/server/Constants.java | 2 ++ server/src/com/vaadin/server/VaadinPortletService.java | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/server/src/com/vaadin/server/Constants.java b/server/src/com/vaadin/server/Constants.java index 2b868c12a6..fc0bf7381a 100644 --- a/server/src/com/vaadin/server/Constants.java +++ b/server/src/com/vaadin/server/Constants.java @@ -162,4 +162,6 @@ public interface Constants { static final String PORTAL_PARAMETER_VAADIN_WIDGETSET = "vaadin.widgetset"; static final String PORTAL_PARAMETER_VAADIN_RESOURCE_PATH = "vaadin.resources.path"; static final String PORTAL_PARAMETER_VAADIN_THEME = "vaadin.theme"; + + static final String PORTLET_CONTEXT = "PORTLET_CONTEXT"; } diff --git a/server/src/com/vaadin/server/VaadinPortletService.java b/server/src/com/vaadin/server/VaadinPortletService.java index 2b290b4cc4..c6d9b8e46a 100644 --- a/server/src/com/vaadin/server/VaadinPortletService.java +++ b/server/src/com/vaadin/server/VaadinPortletService.java @@ -162,7 +162,11 @@ public class VaadinPortletService extends VaadinService { String staticFileLocation = getParameter(request, Constants.PORTAL_PARAMETER_VAADIN_RESOURCE_PATH, "/html"); - return trimTrailingSlashes(staticFileLocation); + if (Constants.PORTLET_CONTEXT.equals(staticFileLocation)) { + return request.getContextPath(); + } else{ + return trimTrailingSlashes(staticFileLocation); + } } private PortletContext getPortletContext() { -- cgit v1.2.3