You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2005/04/21 13:08:08 UTC

svn commit: r164036 - /cocoon/blocks/spring-app/trunk/java/org/apache/cocoon/spring/SpringComponentLocator.java

Author: cziegeler
Date: Thu Apr 21 04:08:05 2005
New Revision: 164036

URL: http://svn.apache.org/viewcvs?rev=164036&view=rev
Log:
Store context in request local attribute

Modified:
    cocoon/blocks/spring-app/trunk/java/org/apache/cocoon/spring/SpringComponentLocator.java

Modified: cocoon/blocks/spring-app/trunk/java/org/apache/cocoon/spring/SpringComponentLocator.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/spring-app/trunk/java/org/apache/cocoon/spring/SpringComponentLocator.java?rev=164036&r1=164035&r2=164036&view=diff
==============================================================================
--- cocoon/blocks/spring-app/trunk/java/org/apache/cocoon/spring/SpringComponentLocator.java (original)
+++ cocoon/blocks/spring-app/trunk/java/org/apache/cocoon/spring/SpringComponentLocator.java Thu Apr 21 04:08:05 2005
@@ -251,7 +251,7 @@
      */
     protected ApplicationContext getParentContext() {
         final Request request = ObjectModelHelper.getRequest(this.cocoon.getCurrentObjectModel());
-        ApplicationContext parentContext = (ApplicationContext)request.getAttribute(APPLICATION_CONTEXT_REQUEST_ATTRIBUTE);
+        ApplicationContext parentContext = (ApplicationContext)request.getAttribute(APPLICATION_CONTEXT_REQUEST_ATTRIBUTE, Request.REQUEST_SCOPE);
         
         if ( parentContext == null ) {
             // there is no parent sitemap with an application context
@@ -267,16 +267,16 @@
      */
     public void enteredSitemap(EnterSitemapEvent event) {
         final Request request = ObjectModelHelper.getRequest(event.getEnvironment().getObjectModel());
-        final Object oldContext = request.getAttribute(APPLICATION_CONTEXT_REQUEST_ATTRIBUTE);
+        final Object oldContext = request.getAttribute(APPLICATION_CONTEXT_REQUEST_ATTRIBUTE, Request.REQUEST_SCOPE);
         if ( oldContext != null ) {
-            Stack stack = (Stack)request.getAttribute("ac-stack");
+            Stack stack = (Stack)request.getAttribute("ac-stack", Request.REQUEST_SCOPE);
             if ( stack == null ) {
                 stack = new Stack();
-                request.setAttribute("ac-stack", stack);
+                request.setAttribute("ac-stack", stack, Request.REQUEST_SCOPE);
             }
             stack.push(oldContext);
         }
-        request.setAttribute(APPLICATION_CONTEXT_REQUEST_ATTRIBUTE, this.wac);
+        request.setAttribute(APPLICATION_CONTEXT_REQUEST_ATTRIBUTE, this.wac, Request.REQUEST_SCOPE);
     }
 
     /**
@@ -284,14 +284,14 @@
      */
     public void leftSitemap(LeaveSitemapEvent event) {
         final Request request = ObjectModelHelper.getRequest(event.getEnvironment().getObjectModel());
-        final Stack stack = (Stack)request.getAttribute("ac-stack");
+        final Stack stack = (Stack)request.getAttribute("ac-stack", Request.REQUEST_SCOPE);
         if ( stack == null ) {
-            request.removeAttribute(APPLICATION_CONTEXT_REQUEST_ATTRIBUTE);
+            request.removeAttribute(APPLICATION_CONTEXT_REQUEST_ATTRIBUTE, Request.REQUEST_SCOPE);
         } else {
             final Object oldContext = stack.pop();
-            request.setAttribute(APPLICATION_CONTEXT_REQUEST_ATTRIBUTE, oldContext);
+            request.setAttribute(APPLICATION_CONTEXT_REQUEST_ATTRIBUTE, oldContext, Request.REQUEST_SCOPE);
             if ( stack.size() == 0 ) {
-                request.removeAttribute("ac-stack");
+                request.removeAttribute("ac-stack", Request.REQUEST_SCOPE);
             }
         }
     }