You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Berin Loritsch <bl...@infoplanning.com> on 2000/12/02 00:48:51 UTC

[RT] redirection vs. aliases

Thanks to my experience with trying to get C2 working with
WebSphere, and ColdFusion to work with Netscape Enterprise
Server, I have come to a very important realization.  No
vendor does redirection the same way (and some just do it
incorrectly).  A redirection is supposed to be a very simple
thing; however, it is causing me more problems than you
might imagine.

As an example, Apache httpd and Tomcat both perform redirects
as you might expect--it simply gives you the new page without
any funky HTTP status messages.  IBM has perverted Apache
with it's IBM HTTP Server (works with WebSphere), and Netscape
give a funny redirection HTTP response and most browsers can't
handle it.  Instead of the desired result (the new page),
it gives you "Page Unavailable" in IE or no result in Netscape 6.

Why is this an issue?  With ColdFusion, the only way to have
semi maintainable pages is to separate the logic sheets from
the display sheets and use redirection to get you to the next
stage.  My user state information gets lost if the server
screws up.  With Cocoon, I can use the sitemap to send me to
a default screen or even perform the same type of separation
with my XSP pages.

What I really want: an alias.  I am not trying to go to another
machine, or even another context.  I just want one page in place
of another.

How it would work: any time Cocoon intercepts a redirect() method
call, it processes the new URI in the same stream.  This has
the same effect, and you don't have Web server vendors screwing
you blind.

Do I sound like I am somewhere outside the loop, or is my frustration
shared?

---------------------------------------
If you lust for Ham and Eggs, you have
committed breakfast in your heart
already.   -- C. S. Lewis


Re: [RT] redirection vs. aliases

Posted by Paul Russell <pa...@luminas.co.uk>.
On Fri, Dec 01, 2000 at 06:48:51PM -0500, Berin Loritsch wrote:
> As an example, Apache httpd and Tomcat both perform redirects
> as you might expect--it simply gives you the new page without
> any funky HTTP status messages.  IBM has perverted Apache
> with it's IBM HTTP Server (works with WebSphere), and Netscape
> give a funny redirection HTTP response and most browsers can't
> handle it.  Instead of the desired result (the new page),
> it gives you "Page Unavailable" in IE or no result in Netscape 6.

Uh. I'm not at *all* sure this is the case. As far as I am
aware, apache issues a 301, 302 or 303 as appropriate. To do
otherwise when a redirect is requested would place apache/tomcat
outside the HTTP specification, which must be A Bad Thing.
Aliases, on the other hand, should work internally, obviously..


Paul, wondering if he missed something.

-- 
Paul Russell                               <pa...@luminas.co.uk>
Technical Director,                   http://www.luminas.co.uk
Luminas Ltd.

Re: [RT] redirection vs. aliases

Posted by Berin Loritsch <bl...@infoplanning.com>.
----- Original Message ----- 
From: "Paul Russell" <pa...@luminas.co.uk>
To: <co...@xml.apache.org>
Sent: Monday, December 04, 2000 9:47 AM
Subject: Re: [RT] redirection vs. aliases


> On Mon, Dec 04, 2000 at 09:28:59AM -0500, Berin Loritsch wrote:
> > > What you want is something like:
> > > 
> > >   <map:redirect-to cocoon="..."/>
> > > 
> > > which should reinvoke the sitemap engine with a different requestURI,
> > > right? If this is the case we have to extend the Environment interface
> > > to let the sitemap notice the Environment to change the requestURI and
> > > reinvoke itself again?
> > Yes.  This is what I would like.  This would work wonders within the
> > framework of one Cocoon webapp.
> 
> Yahuh. Could we make it <map:redirect-to internal="..."/>
> though? I don't think 'cocoon' is particularly clear as an
> attribute name.. Thoughts?

<map:redirect-to resource="..."/>
<map:redirect-to internal="..."/>
<map:redirect-to local="..."/>

any of these would be fine.


Re: [RT] redirection vs. aliases

Posted by Giacomo Pati <gi...@apache.org>.
Vadim Gritsenko wrote:
> 
> How about <map:forward-to internal="..."/>?
> 
> The difference between HTTP redirect and internal forwarding is that in case
> of
> redirecting client gets HTTP redirect code (300+), and in case of forwarding
> existing HttpServletRequest object is used as input to forwarded page - so,
> pages can store some state information in request object.

Your suggestions might be right but I'd like to keep down with the
introduction of new elements into the sitemaps schema. So for me a

   <map:redirect-to internal="...."/> 

would be fine.

I wish I had implemented all those resource references strictly as URL.
But since Stefano mentioned that Avalon might build up a general URL
Handler framework we agreed to be fine with it for now :(

Giacomo

> 
> AFAIK, forwarding is implemented in servlets API:
>     request.getRequestDispatcher("some/page").forward(request, response);
> This code should invoke CocoonServlet (if "some/page" registered with it)
> once again.
> Does anybody have an idea does this piece of code work with Cocoon or not?
> 
> Thanks,
> Vadim
> 
> > -----Original Message-----
> > From: Paul Russell [mailto:paulr@luminas.co.uk]On Behalf Of Paul Russell
> > Sent: Monday, December 04, 2000 9:48 AM
> > To: cocoon-dev@xml.apache.org
> > Subject: Re: [RT] redirection vs. aliases
> >
> >
> > On Mon, Dec 04, 2000 at 09:28:59AM -0500, Berin Loritsch wrote:
> > > > What you want is something like:
> > > >
> > > >   <map:redirect-to cocoon="..."/>
> > > >
> > > > which should reinvoke the sitemap engine with a different requestURI,
> > > > right? If this is the case we have to extend the Environment interface
> > > > to let the sitemap notice the Environment to change the requestURI and
> > > > reinvoke itself again?
> > > Yes.  This is what I would like.  This would work wonders within the
> > > framework of one Cocoon webapp.
> >
> > Yahuh. Could we make it <map:redirect-to internal="..."/>
> > though? I don't think 'cocoon' is particularly clear as an
> > attribute name.. Thoughts?
> >
> >
> > P.
> >
> > --
> > Paul Russell                               <pa...@luminas.co.uk>
> > Technical Director,                   http://www.luminas.co.uk
> > Luminas Ltd.
> >

RE: [RT] redirection vs. aliases

Posted by Vadim Gritsenko <vg...@hns.com>.
How about <map:forward-to internal="..."/>?

The difference between HTTP redirect and internal forwarding is that in case
of
redirecting client gets HTTP redirect code (300+), and in case of forwarding
existing HttpServletRequest object is used as input to forwarded page - so,
pages can store some state information in request object.

AFAIK, forwarding is implemented in servlets API:
    request.getRequestDispatcher("some/page").forward(request, response);
This code should invoke CocoonServlet (if "some/page" registered with it)
once again.
Does anybody have an idea does this piece of code work with Cocoon or not?


Thanks,
Vadim

> -----Original Message-----
> From: Paul Russell [mailto:paulr@luminas.co.uk]On Behalf Of Paul Russell
> Sent: Monday, December 04, 2000 9:48 AM
> To: cocoon-dev@xml.apache.org
> Subject: Re: [RT] redirection vs. aliases
>
>
> On Mon, Dec 04, 2000 at 09:28:59AM -0500, Berin Loritsch wrote:
> > > What you want is something like:
> > >
> > >   <map:redirect-to cocoon="..."/>
> > >
> > > which should reinvoke the sitemap engine with a different requestURI,
> > > right? If this is the case we have to extend the Environment interface
> > > to let the sitemap notice the Environment to change the requestURI and
> > > reinvoke itself again?
> > Yes.  This is what I would like.  This would work wonders within the
> > framework of one Cocoon webapp.
>
> Yahuh. Could we make it <map:redirect-to internal="..."/>
> though? I don't think 'cocoon' is particularly clear as an
> attribute name.. Thoughts?
>
>
> P.
>
> --
> Paul Russell                               <pa...@luminas.co.uk>
> Technical Director,                   http://www.luminas.co.uk
> Luminas Ltd.
>


Re: [RT] redirection vs. aliases

Posted by Paul Russell <pa...@luminas.co.uk>.
On Mon, Dec 04, 2000 at 09:28:59AM -0500, Berin Loritsch wrote:
> > What you want is something like:
> > 
> >   <map:redirect-to cocoon="..."/>
> > 
> > which should reinvoke the sitemap engine with a different requestURI,
> > right? If this is the case we have to extend the Environment interface
> > to let the sitemap notice the Environment to change the requestURI and
> > reinvoke itself again?
> Yes.  This is what I would like.  This would work wonders within the
> framework of one Cocoon webapp.

Yahuh. Could we make it <map:redirect-to internal="..."/>
though? I don't think 'cocoon' is particularly clear as an
attribute name.. Thoughts?


P.

-- 
Paul Russell                               <pa...@luminas.co.uk>
Technical Director,                   http://www.luminas.co.uk
Luminas Ltd.

Re: [RT] redirection vs. aliases

Posted by Berin Loritsch <bl...@infoplanning.com>.
----- Original Message ----- 
From: "Giacomo Pati" <gi...@apache.org>
To: <co...@xml.apache.org>
Sent: Sunday, December 03, 2000 6:05 PM
Subject: Re: [RT] redirection vs. aliases


> Berin Loritsch wrote:
> > 
> > Thanks to my experience with trying to get C2 working with
> > WebSphere, and ColdFusion to work with Netscape Enterprise
> > Server, I have come to a very important realization.  No
> > vendor does redirection the same way (and some just do it
> > incorrectly).  A redirection is supposed to be a very simple
> > thing; however, it is causing me more problems than you
> > might imagine.
> > 
> > As an example, Apache httpd and Tomcat both perform redirects
> > as you might expect--it simply gives you the new page without
> > any funky HTTP status messages.  IBM has perverted Apache
> > with it's IBM HTTP Server (works with WebSphere), and Netscape
> > give a funny redirection HTTP response and most browsers can't
> > handle it.  Instead of the desired result (the new page),
> > it gives you "Page Unavailable" in IE or no result in Netscape 6.
> > 
> > Why is this an issue?  With ColdFusion, the only way to have
> > semi maintainable pages is to separate the logic sheets from
> > the display sheets and use redirection to get you to the next
> > stage.  My user state information gets lost if the server
> > screws up.  With Cocoon, I can use the sitemap to send me to
> > a default screen or even perform the same type of separation
> > with my XSP pages.
> > 
> > What I really want: an alias.  I am not trying to go to another
> > machine, or even another context.  I just want one page in place
> > of another.
> > 
> > How it would work: any time Cocoon intercepts a redirect() method
> > call, it processes the new URI in the same stream.  This has
> > the same effect, and you don't have Web server vendors screwing
> > you blind.
> > 
> > Do I sound like I am somewhere outside the loop, or is my frustration
> > shared?
> 
> No, it sounds reasonable and I think this was been discussed a real long
> time ago. The sitemap has the notion of two kinds of redirects:
> 
>   <map:redirect-to uri="..."/>
>   <map:redirect-to resource="..."/>
> 
> The first one issues a "normal" redirect using the Environments redirect
> service (because the sitemap engine has no idea of how to do it on its
> own). This can be any legal URL. The second form of redirect-to uses a
> defined <map:resource> to redirect to. What you want is something like:
> 
>   <map:redirect-to cocoon="..."/>
> 
> which should reinvoke the sitemap engine with a different requestURI,
> right? If this is the case we have to extend the Environment interface
> to let the sitemap notice the Environment to change the requestURI and
> reinvoke itself again?

Yes.  This is what I would like.  This would work wonders within the
framework of one Cocoon webapp.


Re: [RT] redirection vs. aliases

Posted by Giacomo Pati <gi...@apache.org>.
Berin Loritsch wrote:
> 
> Thanks to my experience with trying to get C2 working with
> WebSphere, and ColdFusion to work with Netscape Enterprise
> Server, I have come to a very important realization.  No
> vendor does redirection the same way (and some just do it
> incorrectly).  A redirection is supposed to be a very simple
> thing; however, it is causing me more problems than you
> might imagine.
> 
> As an example, Apache httpd and Tomcat both perform redirects
> as you might expect--it simply gives you the new page without
> any funky HTTP status messages.  IBM has perverted Apache
> with it's IBM HTTP Server (works with WebSphere), and Netscape
> give a funny redirection HTTP response and most browsers can't
> handle it.  Instead of the desired result (the new page),
> it gives you "Page Unavailable" in IE or no result in Netscape 6.
> 
> Why is this an issue?  With ColdFusion, the only way to have
> semi maintainable pages is to separate the logic sheets from
> the display sheets and use redirection to get you to the next
> stage.  My user state information gets lost if the server
> screws up.  With Cocoon, I can use the sitemap to send me to
> a default screen or even perform the same type of separation
> with my XSP pages.
> 
> What I really want: an alias.  I am not trying to go to another
> machine, or even another context.  I just want one page in place
> of another.
> 
> How it would work: any time Cocoon intercepts a redirect() method
> call, it processes the new URI in the same stream.  This has
> the same effect, and you don't have Web server vendors screwing
> you blind.
> 
> Do I sound like I am somewhere outside the loop, or is my frustration
> shared?

No, it sounds reasonable and I think this was been discussed a real long
time ago. The sitemap has the notion of two kinds of redirects:

  <map:redirect-to uri="..."/>
  <map:redirect-to resource="..."/>

The first one issues a "normal" redirect using the Environments redirect
service (because the sitemap engine has no idea of how to do it on its
own). This can be any legal URL. The second form of redirect-to uses a
defined <map:resource> to redirect to. What you want is something like:

  <map:redirect-to cocoon="..."/>

which should reinvoke the sitemap engine with a different requestURI,
right? If this is the case we have to extend the Environment interface
to let the sitemap notice the Environment to change the requestURI and
reinvoke itself again?

Giacomo