cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giacomo <giac...@apache.org>
Subject Re: [c2] simple question on map:redirect-to semantics
Date Fri, 18 May 2001 21:07:14 GMT


On Fri, 18 May 2001, Donald Ball wrote:

> On Fri, 18 May 2001, giacomo wrote:
>
> > > assume my c2 webapp is mounted under '/webapp'. when i redirect to a
> > > relative uri:
> > >
> > > <map:match pattern="foo/bar">
> > >   <map:redirect-to uri="bat"/>
> > > </map:match>
> > >
> > > i end up at '/webapp/foo/bat', as one might expect. when i redirect to a
> > > site-absolute uri:
> > >
> > > <map:match pattern="foo/bar">
> > >   <map:redirect-to uri="/bat"/>
> > > </map:match>
> > >
> > > i end up at '/bat'. maybe that's desirable behavior, maybe it's not, but
> > > that's beside the point. my goal is to redirect the url to
> > > '/webapp/bat' without having to put the '/webapp' string inside the uri. i
> > > would think that you could do it like so:
> > >
> > > <map:match pattern="foo/bar">
> > >   <map:redirect-to uri="context://bat"/>
> > > </map:match>
> > >
> > > but that gives me an IllegalArgumentException. any suggestions?
> >
> > Have you tried using
> >
> >  <map:match pattern="foo/bar">
> >    <map:redirect-to uri="../bat"/>
> >  </map:match>
>
> sure, and that works, but i think it's ugly and hard to maintain if you
> deal with deeply structured patterns. e.g. if i move foo/bar to
> resources/foo/bar, i also have to change the redirect uri.

Well, can you imagine what Stefano would say about that? Better plan you
URI space!

Giacomo

> can't we just
> add support for context: urls? i'd also like a context: urlresolver
> transformer so i can have things like this:
>
> <form action="context://add/product"/>
>
> instead of
>
> <form action="/webapp/add/product"/>
>
> in my xhtml pages. but i reckon i need to wait for the entityresolver
> refactorization to take place for both of these...
>
> - donald
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>
>
>


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


Mime
View raw message