]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix for URL generation in browser details request (#8785)
authorArtur Signell <artur@vaadin.com>
Sun, 13 May 2012 22:40:48 +0000 (01:40 +0300)
committerArtur Signell <artur@vaadin.com>
Sun, 13 May 2012 23:10:29 +0000 (02:10 +0300)
src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java

index 1e2687982e427e88feda857c82c9947ae186d60c..55f15da3d993e23a03d005c9768fd648d47912e7 100644 (file)
@@ -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<Connector, Map<String, StreamVariable>> ownerToNameToStreamVariable;
 
     @Override