incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1183349 - /sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/services/DefaultPortletInvokerService.java
Date Fri, 14 Oct 2011 13:27:50 GMT
Author: cziegeler
Date: Fri Oct 14 13:27:50 2011
New Revision: 1183349

URL: http://svn.apache.org/viewvc?rev=1183349&view=rev
Log:
Make sure to remove all attributes and keep javax. attributes when calling into the portlet

Modified:
    sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/services/DefaultPortletInvokerService.java

Modified: sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/services/DefaultPortletInvokerService.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/services/DefaultPortletInvokerService.java?rev=1183349&r1=1183348&r2=1183349&view=diff
==============================================================================
--- sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/services/DefaultPortletInvokerService.java
(original)
+++ sling/whiteboard/portal/container/src/main/java/org/apache/sling/portal/container/internal/services/DefaultPortletInvokerService.java
Fri Oct 14 13:27:50 2011
@@ -178,12 +178,13 @@ public class DefaultPortletInvokerServic
                 final HttpServletResponse containerResponse = context.getContainerResponse();
 
                 try {
+                    containerRequest.setAttribute(ATTR_PORTLET, portletEntity);
                     containerRequest.setAttribute(Container.ATTR_CONTAINER, this);
                     containerRequest.setAttribute(PortletInvokerService.METHOD_ID, methodID);
                     containerRequest.setAttribute(PortletInvokerService.PORTLET_REQUEST,
request);
                     containerRequest.setAttribute(PortletInvokerService.PORTLET_RESPONSE,
response);
                     containerRequest.setAttribute(PortletInvokerService.FILTER_MANAGER, filterManager);
-                    containerRequest.setAttribute(ATTR_PORTLET, portletEntity);
+                    containerRequest.setAttribute(PortletInvokerService.PORTLET_CONFIG, context.getPortletConfig());
 
                     if (methodID.equals(PortletInvokerService.METHOD_RESOURCE)) {
                         dispatcher.forward(containerRequest, containerResponse);
@@ -217,10 +218,13 @@ public class DefaultPortletInvokerServic
 
                 } finally {
                     containerRequest.removeAttribute(ATTR_PROCESSED);
+                    containerRequest.removeAttribute(ATTR_PORTLET);
+                    containerRequest.removeAttribute(Container.ATTR_CONTAINER);
                     containerRequest.removeAttribute(PortletInvokerService.METHOD_ID);
                     containerRequest.removeAttribute(PortletInvokerService.PORTLET_REQUEST);
                     containerRequest.removeAttribute(PortletInvokerService.PORTLET_RESPONSE);
                     containerRequest.removeAttribute(PortletInvokerService.FILTER_MANAGER);
+                    containerRequest.removeAttribute(PortletInvokerService.PORTLET_CONFIG);
                 }
             } else {
                 throw new PortletException("Unable to retrieve portlet invoker dispatcher.
Check if the container servlet is running in the portlet application.");
@@ -254,10 +258,8 @@ public class DefaultPortletInvokerServic
         final SlingPortletConfig portletConfig = info.getPortletConfig();
         final SlingPortletContext portletContext = info.getPortletContext();
 
-        // remove attributes
+        // remove attributes we don't want to pass to the portlet
         request.removeAttribute(PortletInvokerService.METHOD_ID);
-        request.removeAttribute(PortletInvokerService.PORTLET_REQUEST);
-        request.removeAttribute(PortletInvokerService.PORTLET_RESPONSE);
         request.removeAttribute(PortletInvokerService.FILTER_MANAGER);
         request.removeAttribute(ATTR_PORTLET);
 



Mime
View raw message