summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2011-12-20 12:20:20 +0200
committerLeif Åstrand <leif@vaadin.com>2011-12-20 12:20:34 +0200
commite27c874c518000e4151072bd681494254ddf5352 (patch)
treeb99049af16cbebaf791374cff45dbb1dfc1c7e80
parent1981c9153a04c2e93cd3d64e22cbf5e2f6bd1d26 (diff)
downloadvaadin-framework-e27c874c518000e4151072bd681494254ddf5352.tar.gz
vaadin-framework-e27c874c518000e4151072bd681494254ddf5352.zip
Fix more issues related to browserDetails requests in portlets (#8052)
-rw-r--r--src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java13
-rw-r--r--src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java2
2 files changed, 14 insertions, 1 deletions
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
index 7b8b146075..08b608db0d 100644
--- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
+++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
@@ -44,6 +44,7 @@ import com.liferay.portal.kernel.util.PortalClassInvoker;
import com.liferay.portal.kernel.util.PropsUtil;
import com.vaadin.Application;
import com.vaadin.Application.SystemMessages;
+import com.vaadin.RootRequiresMoreInformation;
import com.vaadin.terminal.DeploymentConfiguration;
import com.vaadin.terminal.Terminal;
import com.vaadin.terminal.WrappedRequest;
@@ -609,6 +610,14 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
synchronized (application) {
if (application.isRunning()) {
switch (requestType) {
+ case RENDER:
+ try {
+ root = application
+ .getRootForRequest(wrappedRequest);
+ } catch (RootRequiresMoreInformation e) {
+ // Ignore problem and continue without root
+ }
+ break;
case BROWSER_DETAILS:
// Should not try to find a root here as the
// combined request details might change the root
@@ -967,6 +976,10 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
throws PortletException {
try {
final Application application = getApplicationClass().newInstance();
+ if (application.getRootPreserveStrategy() == null) {
+ application
+ .setRootPreserveStrategy(new Application.WindowNameRootPreserveStrategy());
+ }
return application;
} catch (final IllegalAccessException e) {
throw new PortletException("getNewApplication failed", e);
diff --git a/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java
index a20eb21468..61a9dbc821 100644
--- a/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java
+++ b/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java
@@ -189,7 +189,7 @@ public class PortletCommunicationManager extends AbstractCommunicationManager {
String portalThemeUri = getThemeUri(context, portalTheme);
// XSS safe - originates from portal properties
context.getWriter().write(
- "vaadin.loadTheme('" + portalThemeUri + "')");
+ "vaadin.loadTheme('" + portalThemeUri + "');");
}
super.writeMainScriptTagContents(context);