You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Kees van Dieren <ke...@keesvandieren.nl> on 2004/10/20 11:07:27 UTC

JSPReader.generate after cocoon redirect

Hello,

In a Cocoon action, I try to use the Redirector to redirect with a cocoon
internal redirect to another url.

The simplified action action handler method is:
    public final Map act(Redirector aRedirector, SourceResolver
aSourceResolver, Map anObjectModel, String aSource,
            Parameters aParameterList) throws Exception {
        String myRedirectPage = "cocoon:/generic_save_redirect";
        aRedirector.redirect(true, myRedirectPage);

        return EMPTY_MAP;

    }
This does not work. When I change myRedirectPage to:

String myRedirectPage = "generic_save_redirect";

everything works. This is not a solution that fits for me, because I would
like to share attributes from the Request object.

The url generic_save_redirect is mapped in the sitemap to a JSP. the
JSPReader generates the following exception:

Error code:	Exception JSPReader.generate()
Error message:	org.apache.cocoon.ProcessingException: Exception
JSPReader.generate(): java.lang.StringIndexOutOfBoundsException: String
index out of range: -1
Details:
org.apache.cocoon.ProcessingException
org.apache.cocoon.ProcessingException: Exception JSPReader.generate():
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at org.apache.cocoon.reading.JSPReader.generate(JSPReader.java:136) at
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processReader(AbstractCachingProcessingPipeline.java:810)
at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:489)
at
org.apache.cocoon.components.treeprocessor.sitemap.ReadNode.invoke(ReadNode.java:119)
at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84)
at
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164)
at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:164)
at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108)
at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:161)
at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:327)
at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:309)
at
org.apache.cocoon.environment.ForwardRedirector.cocoonRedirect(ForwardRedirector.java:223)
at
org.apache.cocoon.environment.ForwardRedirector.redirect(ForwardRedirector.java:114)

(after that my custom-made code)

Does anyone have an idea why this error occurs, or any tips to make it
work in another way?

The thing I would like to make is to execute a JSP, and fetch the result
without letting change the url. However in the context of the code, it's
required to fetch it in the Java code instead of doing it in the sitemap.

I'm using Cocoon 2.1.3

Thanks in advance.

Kind regards,

Kees van Dieren



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org