You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by st...@outerthought.org on 2004/05/24 19:00:06 UTC

[WIKI-UPDATE] Redirecting Main IndexPage LenyaFAQ Mon May 24 19:00:06 2004

Page: http://wiki.cocoondev.org/Wiki.jsp?page=Redirecting , version: 6 on Sun May 24 16:29:31 2004 by 62.148.39.161

+ ----
+ 
+ Another reply:
+ 
+ I wanted to redirect according to a URL provided in one of the XML documents being processed; something like this:
+ 
+ {{{
+   <map:match pattern="my-resource">
+     ...
+     <map:transform type="special-transformer"/>
+     <map:redirect-to uri="{request-attr:my-parameter}"/>
+   </map:match>
+ }}}
+ 
+ Here, the "special-transformer" would be based on AbstractDOMTransformer and set request attributes when it saw various things in the document. Unfortunately, the redirect is "precalculated" and the desired value for "my-parameter" never gets used.
+ 
+ So what I did instead was to use some arguably nasty code in my "special-transformer" to set the redirect:
+ 
+ {{{
+ import org.apache.cocoon.environment.Response;
+ import org.apache.cocoon.environment.http.HttpResponse;
+ 
+   // ...
+ 
+   if (response instanceof HttpResponse) {
+     ((HttpResponse) response).sendPermanentRedirect(target);
+   }
+ }}}
+ 
+ This isn't nice, but there really doesn't seem to be any sane way in "vanilla" Cocoon where sitemap actions can be influenced by the content being processed. I don't want to use FlowScript, XSP or any of the peripherals.
+ 


Page: http://wiki.cocoondev.org/Wiki.jsp?page=Main , version: 448 on Sun May 24 16:56:10 2004 by 66.166.158.10

- [Mature Lady|http-link-to-mature.olderlady.net/]
- [Grannies|http-link-to-granny.olderlady.net/]
- [Spank Gay|http-link-to-spank.realyoungboy.com/]


Page: http://wiki.cocoondev.org/Wiki.jsp?page=IndexPage , version: 6 on Sun May 24 16:56:56 2004 by 66.166.158.10

- [http-link-to-www.chinarbb.com]


Page: http://wiki.cocoondev.org/Wiki.jsp?page=LenyaFAQ , version: 86 on Sun May 24 16:17:07 2004 by 195.158.156.101

- !Why do i get an "illega cookie" warning with all the lenya reference sites with Opera?
?         ^                                                                   ^ ^^

+ !Why do I get an "illegal cookie" warning with all the lenya reference sites using Opera?
?         ^               +                                                    ^^ ^^