cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: Standardizing Redirect in Cocoon
Date Mon, 16 Apr 2001 12:21:29 GMT
Donald Ball wrote:
> 
> On Fri, 13 Apr 2001, Berin Loritsch wrote:
> 
> > > > and if the "context:" protocol is specified, then the URL should be
> > > > relative to the context root.  This should be easy in Cocoon 2, because
> > > > we are limiting the access to the redirect function--I don't know about
> > > > Cocoon 1.
> > >
> > > Can you explain a bit in detail?
> >
> > Basically something like this:
> >
> > Current URI:     "http://localhost/cocoon/foo/bar/index.html"
> > Current context: "cocoon"
> >
> > CURRENTLY DONE BY SERVLET API
> > Redirect-to: "/index.html"      maps to "http://localhost/index.html"
> > Redirect-to: "../index.html"    maps to "http://localhost/cocoon/foo/index.html"
> >
> > NEW FUNCTIONALITY
> > Redirect-to: "context://index.html" maps to "http://localhost/cocoon/index.html"
> >
> > If the context is moved to "margaritaville/parrothead"
> > then the context urls won't have to be changed
> > ("http://localhost/margaritaville/parrothead/index.html")
> > to go to the new location.
> >
> > Absolute urls like "/cocoon/index.html" won't work in that case, they
> > would have to be changed in the code.
> 
> +1. i was also thinking about how to link to c2 resources as well. fer
> instance, suppose i have an image located at
> 
> context://resources/images/pretty.gif
> 
> in a webapp mounted at 'foo'. the only way i can reliably link to that
> image across all of the pages in my webapp is to link to
> 
> '/foo/resources/images/pretty.gif'
> 
> i'd think it would be pretty cool to have a filter which would check for
> context urls in certain HTML elements (a:href, img:src, etc.) and
> translate context: urls appropriately. anyone else think this would be
> useful?

Yup.  That would be useful, but probably best done as a transformer.  The
transformer would be very light weight.

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


Mime
View raw message