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 2004/08/17 13:05:14 UTC
svn commit: rev 36514 - in cocoon/trunk: . src/java/org/apache/cocoon/components/treeprocessor src/java/org/apache/cocoon/environment/internal
Author: cziegeler
Date: Tue Aug 17 04:05:12 2004
New Revision: 36514
Modified:
cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
cocoon/trunk/src/java/org/apache/cocoon/environment/internal/ForwardEnvironmentWrapper.java
cocoon/trunk/status.xml
Log:
Fix bug in redirecting when called from flow
Modified: cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java Tue Aug 17 04:05:12 2004
@@ -46,7 +46,7 @@
* The concrete implementation of {@link Processor}, containing the evaluation tree and associated
* data such as component manager.
*
- * @version CVS $Id: ConcreteTreeProcessor.java,v 1.5 2004/07/15 12:49:50 sylvain Exp $
+ * @version CVS $Id$
*/
public class ConcreteTreeProcessor extends AbstractLogEnabled implements Processor {
@@ -344,7 +344,7 @@
if (facade != null) {
// Change the facade delegate
- facade.setDelegate((EnvironmentWrapper)newEnv);
+ facade.setDelegate((ForwardEnvironmentWrapper)newEnv);
newEnv = facade;
}
@@ -359,7 +359,12 @@
// Process the redirect
// No more reset since with TreeProcessorRedirector, we need to pop values from the redirect location
// context.reset();
- return processor.process(newEnv, context);
+ // The following is a fix for bug #26854 and #26571
+ final boolean result = processor.process(newEnv, context);
+ if ( ((ForwardEnvironmentWrapper)newEnv).getRedirectURL() != null ) {
+ environment.redirect( ((ForwardEnvironmentWrapper)newEnv).getRedirectURL(), false, false);
+ }
+ return result;
}
public void dispose() {
Modified: cocoon/trunk/src/java/org/apache/cocoon/environment/internal/ForwardEnvironmentWrapper.java
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/environment/internal/ForwardEnvironmentWrapper.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/environment/internal/ForwardEnvironmentWrapper.java Tue Aug 17 04:05:12 2004
@@ -15,6 +15,7 @@
*/
package org.apache.cocoon.environment.internal;
+import java.io.IOException;
import java.net.MalformedURLException;
import org.apache.avalon.framework.logger.Logger;
@@ -26,7 +27,7 @@
* Local extension of EnvironmentWrapper to propagate otherwise blocked
* methods to the actual environment.
*
- * @version CVS $Id: ForwardEnvironmentWrapper.java,v 1.1 2004/06/25 15:36:38 cziegeler Exp $
+ * @version CVS $Id$
*/
public final class ForwardEnvironmentWrapper extends EnvironmentWrapper {
@@ -78,4 +79,13 @@
public void setResponseIsNotModified() {
environment.setResponseIsNotModified();
}
+
+ /* (non-Javadoc)
+ * @see org.apache.cocoon.environment.Environment#redirect(java.lang.String, boolean, boolean)
+ public void redirect(String newURL, boolean global, boolean permanent)
+ throws IOException {
+ this.environment.redirect(newURL, global, permanent);
+ }
+ */
+
}
Modified: cocoon/trunk/status.xml
==============================================================================
--- cocoon/trunk/status.xml (original)
+++ cocoon/trunk/status.xml Tue Aug 17 04:05:12 2004
@@ -204,6 +204,9 @@
<changes>
<release version="@version@" date="@date@">
+ <action dev="CZ" type="fix" fixes-bug="26854">
+ A redirect is now possible, if it's called from flow. This also fixes bug #26571.
+ </action>
<action dev="CZ" type="add" fixes-bug="30688" due-to="John Lianoglou" due-to-email="john@arachnedesign.net">
Mail block: Add ability to specify mime-type for email body text parameter in the mail transformer.
</action>