Update of 
/var/cvs/contributions/CMSContainer/cmsc/portal/src/java/com/finalist/pluto/portalImpl/aggregation
In directory 
james.mmbase.org:/tmp/cvs-serv657/cmsc/portal/src/java/com/finalist/pluto/portalImpl/aggregation

Modified Files:
      Tag: b1_4
        PortletFragment.java ScreenFragment.java 
Log Message:
CMSC-863 HttpSessions are used when not necessary and created for useragents 
which do not maintain a session


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer/cmsc/portal/src/java/com/finalist/pluto/portalImpl/aggregation
See also: http://www.mmbase.org/jira/browse/CMSC-863


Index: PortletFragment.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer/cmsc/portal/src/java/com/finalist/pluto/portalImpl/aggregation/PortletFragment.java,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -u -b -r1.10 -r1.10.2.1
--- PortletFragment.java        26 Nov 2007 11:43:39 -0000      1.10
+++ PortletFragment.java        21 Apr 2008 10:11:29 -0000      1.10.2.1
@@ -144,6 +144,7 @@
       catch (PortletContainerException e) {
          log.fatal("portlet container raised an exception", e);
       }
+      cleanRequest(request);
    }
 
 
@@ -204,7 +205,6 @@
       ServletDefinition servletDefinition = getServletDefinition();
 
       if (servletDefinition != null && !servletDefinition.isUnavailable()) {
-         request.setAttribute(PortalConstants.FRAGMENT, this);
          PrintWriter writer2 = new PrintWriter(storedWriter);
 
          // create a wrapped response which the Portlet will be rendered to
@@ -236,17 +236,23 @@
             writer2.println(getErrorMsg(e));
          }
 
-         request.removeAttribute(PortalConstants.FRAGMENT);
       }
       else {
          log.error("Error no servletDefinition!!!");
       }
+      cleanRequest(request);
       log.debug("PortletFragment service exits");
    }
 
 
    private void setupRequest(HttpServletRequest request) {
       request.setAttribute(PortalConstants.CMSC_OM_PORTLET_LAYOUTID, getKey());
+      request.setAttribute(PortalConstants.FRAGMENT, this);
+   }
+
+   private void cleanRequest(HttpServletRequest request) {
+       request.removeAttribute(PortalConstants.FRAGMENT);
+       request.removeAttribute(PortalConstants.CMSC_OM_PORTLET_LAYOUTID);
    }
 
 


Index: ScreenFragment.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer/cmsc/portal/src/java/com/finalist/pluto/portalImpl/aggregation/ScreenFragment.java,v
retrieving revision 1.9.2.1
retrieving revision 1.9.2.2
diff -u -b -r1.9.2.1 -r1.9.2.2
--- ScreenFragment.java 31 Mar 2008 09:01:55 -0000      1.9.2.1
+++ ScreenFragment.java 21 Apr 2008 10:11:29 -0000      1.9.2.2
@@ -40,6 +40,7 @@
       PortletFragment pf = getFragment(actionFragment);
       setupRequest(request);
       pf.processAction(request, response);
+      cleanRequest(request);
    }
 
 
@@ -69,6 +70,7 @@
       else {
          log.error("No page for ScreenFragment");
       }
+      cleanRequest(request);
    }
 
 
@@ -76,6 +78,10 @@
       request.setAttribute(PortalConstants.CMSC_OM_PAGE_ID, 
String.valueOf(getPage().getId()));
    }
 
+   private void cleanRequest(HttpServletRequest request) {
+       request.removeAttribute(PortalConstants.CMSC_OM_PAGE_ID);
+   }
+
 
    public Page getPage() {
       return page;
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to