cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <giac...@apache.org>
Subject Re: [C2]: Request/Response cleanup?
Date Tue, 10 Apr 2001 07:43:51 GMT
Quoting Donald Ball <balld@webslingerZ.com>:

> On Tue, 10 Apr 2001, giacomo wrote:
> 
> > > > I don't see
> > > > > any real reason at the moment to have sendRedirect in C2. But
> maybe
> > > > > someone can explain a situation where you need a programatic
> redirect.
> > > >
> > > > We use sendRedirect heavily for bouncing people off a cocoon
> enabled site to
> > > > other external resouces. This allows us to centrally manage (and
> control)
> > > > the information we are serving. This is a common thing to do, make
> sure that
> > > > the users browser redirects off a central server even when they
> getting
> > > > content from a satelite (or third party site). The sitemap along
> with an XSP
> > > > script makes a good url redirector!
> > >
> > > what he said. sure, you can do redirects from the sitemap, but it's
> nice
> > > to be able to do them from xsp pages or another sitemap component.
> >
> > There are other nice things _not_ in C2 because of some good reason.
> > Why is redirection nice? What's the use case for rediretion inside
> > components (includes XSP pages) ?
> 
> okay. suppose i want to send the user to a URL i have pulled from a
> database? it should not be the case that i have to declare every URL to
> which i can redirect in the sitemap. i suppose one could write a match
> rule like this:
> 
> <map:match pattern="/redirect?url=*">
>   <map:redirect-to url="{$1}"/>
> </map:match>
> 
> and do it that way. but i can't see why it would be better that way than
> by using a sendRedirect method. it will certainly make people complain.

Because the sendRedirect method does not accomplish the model of sub pipelines. 
In a sub pipeline you might have a different context than the context of the 
cocoon servlet. The sitemap is telling the Environment object to enter a new 
context depending on <map:mount> elements but a component should think it is 
always at the top of a context (SoC I think).

But anyway your proposed sitemap snippet shows how to do it. Maybe a correct 
implementation will use an Action to determine the redirection URI like this:

 <map:match pattern="/redirect">
  <map:act type="redirector">
   <map:redirect-to url="{$redirection-uri}"/>
  </map:act>
 </map:match>

Giacomo

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


Mime
View raw message