From b52a8207073839958eedeaca5cd6c795eca76301 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 14 May 2012 01:40:48 +0300 Subject: [PATCH] Fix for URL generation in browser details request (#8785) --- .../server/PortletCommunicationManager.java | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java index 1e2687982e..55f15da3d9 100644 --- a/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java @@ -15,7 +15,6 @@ import javax.portlet.PortletRequest; import javax.portlet.PortletResponse; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; -import javax.portlet.ResourceResponse; import javax.portlet.ResourceURL; import com.vaadin.Application; @@ -85,8 +84,7 @@ public class PortletCommunicationManager extends AbstractCommunicationManager { @Override protected boolean handleApplicationRequest(WrappedRequest request, WrappedResponse response) throws IOException { - currentMimeResponse = (RenderResponse) ((WrappedPortletResponse) response) - .getPortletResponse(); + setCurrentMimeReponse(response); try { return super.handleApplicationRequest(request, response); } finally { @@ -94,16 +92,34 @@ public class PortletCommunicationManager extends AbstractCommunicationManager { } } + private void setCurrentMimeReponse(WrappedResponse response) { + PortletResponse portletResponse = ((WrappedPortletResponse) response) + .getPortletResponse(); + if (portletResponse instanceof MimeResponse) { + currentMimeResponse = (MimeResponse) portletResponse; + } + + } + @Override public void handleUidlRequest(WrappedRequest request, WrappedResponse response, Callback callback, Root root) throws IOException, InvalidUIDLSecurityKeyException { - currentMimeResponse = (ResourceResponse) ((WrappedPortletResponse) response) - .getPortletResponse(); + setCurrentMimeReponse(response); super.handleUidlRequest(request, response, callback, root); currentMimeResponse = null; } + @Override + public void handleBrowserDetailsRequest(WrappedRequest request, + WrappedResponse response, Application application) + throws IOException { + setCurrentMimeReponse(response); + super.handleBrowserDetailsRequest(request, response, application); + currentMimeResponse = null; + + } + private Map> ownerToNameToStreamVariable; @Override -- 2.39.5