cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <>
Subject Re: [C2]: Request/Response cleanup?
Date Tue, 10 Apr 2001 16:39:29 GMT
On Tue, 10 Apr 2001, Giacomo Pati wrote:

> > 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).

uh, you're thinking of the sendRedirect method from the
HttpServletResponse object. our Response object could do something totally
different when sendRedirect is called on it.

> 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>

i still don't see why that's any cleaner than providing a sendRedirect
method. how would a sitemap component or xsp page actually go about
sending a redirect based on some runtime condition using this methodology?

- donald

To unsubscribe, e-mail:
For additional commands, email:

View raw message