cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicola Ken Barozzi" <nicola...@apache.org>
Subject Re: how do I redirect in an Action?
Date Thu, 23 May 2002 06:48:35 GMT
> Liam Morley
>
> On Wed, 22 May 2002, Nicola Ken Barozzi wrote:
>
> > From: "Christopher Painter-Wakefield" <paint007@mc.duke.edu>
> >
> > > What is the proper way to redirect in an Action?
> >
> > Why do you have to redirect in an action?
> > I would not suggest it.
> >
> > Redirect instead in the sitemap based on the results of the Action.
> >
> I've always used the "redirect" method of the Redirector class. I'm
> assuming that redirect uses a local, relative path (for internal links)
> and globalRedirect uses a global path (for external links), but I haven't
> tested this and can't be sure. I also assume that sessionmode dictates
> whether or not to pass the session cookie on (there is a similar attribute
> in the sitemap redirect-to), but again I'm not sure and haven't tested.
>
> there have been times where I have wanted to redirect to the referer from
> an action, so that the action simply changes the state of something on the
> website (for instance, a log-in). I suppose I could pass the referer's
> address to the sitemap.. I'd be interested in hearing reasons of keeping
> the redirect in the sitemap, other than the fact that any changes to java
> code mean recompiling/restarting.. but changes to the sitemap also require
> recompiling and restarting tomcat, which seem to take longer for me (as
> the sitemap can no longer be loaded from cache).

Changes to the sitemap don't require recompiling and restarting tomcat.
If you need to do it, there is something plainly wrong with your Cocoon; I
can't imagine how you managed to keep using cocoon given this :-O

Anyway, the main reason is architectural.

Cocoon was made with a sitemap because this makes the flow control and the
component declaration in a central place; the whole site is much easier to
administer and the components are easier to reuse.

If your Action redirects to a specific url, it's difficult to reuse it in
other sitemaps.

--
Nicola Ken Barozzi                   nicolaken@apache.org
            - verba volant, scripta manent -
   (discussions get forgotten, just code remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message