cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zamek <za...@vili.pmmf.hu>
Subject Re: execute xsp and then redirect
Date Tue, 02 Mar 2004 11:48:37 GMT
Hello All,

Thanks it works, but the basically problem is, I cannot redirect after 
delete. Originally I want to do:

 <map:match pattern="delete-**">
    <map:act type="xsp-action" src="java/delete.xsp">
        <map:parameter name="file" value="{1}"/>
        <map-redirect-to uri="list"/>
    </map:act>
    <map:redirect-to uri="error"/>
 </map:match>

but I've got an error:

Redirection limit for this URL exceeded. Unable to load the requested
page. This may be caused by cookies that are blocked.

If I change "<map:redirec-to..." to 

 <map:match pattern="delete-**">
   <map:act type="xsp-action" src="java/delete.xsp">
      <map:parameter name="file" value="{1}"/>
      <map:generate type="directory" src=".">
        <map:parameter name="depth" value="20"/>
        <map:parameter name="exclude" value="\.xmap$"/>
      </map:generate>
      <map:transform src="dir2html.xsl"/>
      <map:serialize/>
   <map:act>
    <map:redirect-to uri="error"/>
 </map:match>

it works well, but its generate section is similar to "list" pattern.
Are there any forward directive instead of redirect like <jsp:forward>?

On Monday 01 March 2004 21.36, Unico Hommes wrote:
> What you want is not possible. A pipeline consists of at least a
> generator and a serializer. Putting a map:redirect-to after a
> map:generate is incorrect. What you may want to do is use actions or
> else flowscript (the latter being the preferred method).
>
> Something like this (not tested, so will contain bugs):
>
> sitemap.xmap:
> -------------
> <map:match pattern="delete">
>    <map:call function="remove">
>      <map:parameter name="file" value="{request-param:file}"/>
>    </map:call>
> </map:match>
>
> <map:match pattern="list">
>    <map:generate type="directory" src=".">
>      <map:parameter name="depth" value="20"/>
>      <map:parameter name="exclude" value="\.xmap$"/>
>    </map:generate>
>    <map:transform src="dir2html.xsl"/>
>    <map:serialize/>
> </map:match>
>
> flow.js:
> --------
>
> importPackage(Packages.java.io);
>
> function remove() {
>     var file = new File(cocoon.parameters.file);
>     file["delete"];
>     cocoon.redirectTo("list");
> }
>
> Unico
>
> Zamek wrote:
> > Hello All,
> >
> > I have a pattern like:
> >      <map:match pattern="list">
> >         <map:generate type="directory" src=".">
> >           <map:parameter name="depth" value="20"/>
> >           <map:parameter name="exclude" value="\.xmap$"/>
> >         </map:generate>
> >         <map:transform src="dir2html.xsl"/>
> >         <map:serialize/>
> >     </map:match>
> >
> > and if I have a do-delete-** pattern I have to delete the parameter
> > file, and then need to redirect to list.
> >
> >       <map:match pattern="do-delete-**">
> >         <map:generate src="java/delete.xsp" type="serverpages">
> >           <map:parameter name="file" value="{1}"/>
> >         </map:generate>
> >         <map:redirect-to uri="list"/>
> >       </map:match>
> >
> > Redirect cannot works:
> > Redirection limit for this URL exceeded. Unable to load the requested
> > page. This may be caused by cookies that are blocked.
> >
> > How can I combine this?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org

-- 
thx,
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694


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


Mime
View raw message