dev@jsr311.java.net

Re: Redirection and creation <was> Re: Container Independence

From: Dhanji R. Prasanna <dhanji_at_gmail.com>
Date: Thu, 12 Apr 2007 23:40:48 +1000

On 4/12/07, Jerome Louvel <jerome.louvel_at_noelios.com> wrote:
>
>
> Dhanji,
>
> As REST is the architectural style of the Web, I think this usage is
> correct, especially because it doesn't restrict us to HTTP per-se and
> allow
> the mapping of other similar protocols to HTTP semantics.


I like the idea of HTTP-agnosticism, but cant we find a happy middle for
names (that are not already used elsewhere)?


> > return new PermanentRedirect("/target/{orderId}");
> >
> > I like this one too. And the use of a static factory makes
> > this easy to read: return Redirect.to("/target/...");
>
> How is this more complex?
>
> ctx.permanentRedirect("/target/{orderId}");


Because it requires you to expose an injection point for ctx unnecessarily.

Actually, this sort of depends on whether you can send back multiple
redirects in one response. RTF mentioned 4 different types of location
headers.
I know that content-location and location can be used together (is
content-location considered a redirect?). If this is true, I think your idea
of using ctx is probably better.