cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dani...@apache.org
Subject svn commit: r470139 - /cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/BlockContext.java
Date Wed, 01 Nov 2006 23:38:19 GMT
Author: danielf
Date: Wed Nov  1 15:38:18 2006
New Revision: 470139

URL: http://svn.apache.org/viewvc?view=rev&rev=470139
Log:
A new trial to solve the problems described in JIRA COCOON-1939. There might still be some
other problems with the code, so it need a more thorough review.

Modified:
    cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/BlockContext.java

Modified: cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/BlockContext.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/BlockContext.java?view=diff&rev=470139&r1=470138&r2=470139
==============================================================================
--- cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/BlockContext.java
(original)
+++ cocoon/trunk/core/cocoon-blocks-fw/cocoon-blocks-fw-impl/src/main/java/org/apache/cocoon/blocks/BlockContext.java
Wed Nov  1 15:38:18 2006
@@ -377,24 +377,8 @@
             BlockContext.this.log("Enter processing in block " + this.blockName);
             RequestDispatcher dispatcher =
                 this.context.getRequestDispatcher(((HttpServletRequest)request).getPathInfo());
-            if (dispatcher != null) {
-                try {
-                    if (!this.superCall) {
-                        // It is important to set the current block each time
-                        // a new block is entered, this is used for the block
-                        // protocol
-                        BlockCallStack.enterBlock(this.context);
-                    } else {
-                        // A super block should be called in the context of
-                        // the called block to get polymorphic calls resolved
-                        // in the right way. We still need to register the
-                        // current context for resolving super calls relative it.
-                        BlockCallStack.enterSuperBlock(this.context);
-                    }                        
-                    dispatcher.forward(request, response);
-                } finally {
-                    BlockCallStack.leaveBlock();
-                }
+            if (dispatcher != null && dispatcher instanceof PathDispatcher) {
+                ((PathDispatcher)dispatcher).forward(request, response, this.superCall);
             } else {
                 // Cannot happen
                 throw new IllegalStateException();
@@ -433,8 +417,24 @@
          */
         public void forward(ServletRequest request, ServletResponse response)
         throws ServletException, IOException {
+            this.forward(request, response, false);
+        }
+
+        protected void forward(ServletRequest request, ServletResponse response, boolean
superCall)
+        throws ServletException, IOException {
             try {
-                BlockCallStack.enterBlock(BlockContext.this);
+                if (!superCall) {
+                    // It is important to set the current block each time
+                    // a new block is entered, this is used for the block
+                    // protocol
+                    BlockCallStack.enterBlock(BlockContext.this);
+                } else {
+                    // A super block should be called in the context of
+                    // the called block to get polymorphic calls resolved
+                    // in the right way. We still need to register the
+                    // current context for resolving super calls relative it.
+                    BlockCallStack.enterSuperBlock(BlockContext.this);
+                }                        
                 BlockContext.this.servlet.service(request, response);
             } finally {
                 BlockCallStack.leaveBlock();



Mime
View raw message