dev@jsr311.java.net

RE: Redirection and creation

From: Jerome Louvel <jerome.louvel_at_noelios.com>
Date: Fri, 13 Apr 2007 19:21:32 +0200

Hi Marc,

That's an interesting path to explore. I'm still not found of the Response
class and subclasses, but I'm interested to look at an updated API.

Best regards,
Jerome

> -----Message d'origine-----
> De : Marc.Hadley_at_Sun.COM [mailto:Marc.Hadley_at_Sun.COM]
> Envoyé : jeudi 12 avril 2007 21:17
> À : dev_at_jsr311.dev.java.net
> Objet : Re: Redirection and creation
>
> Thinking about it some more, if we applied the same approach for
> Response as I just suggested for Representation in the "Mapping
> POJOs" thread it might help with this thread too.
>
> To sketch it out a little more:
>
> - the API defines a set of fine grained annotations for metadata
> (media-type, location, content location, language etc)
> - an @HttpMethod/_at_Method/_at_WebMethod annotated method could
> return any
> type of object or primitive type
> - method or resource-class level annotations would provide metadata
> default values
> - annotated properties of the returned object would provide metadata
> and override defaults specified at the method or resource class level
> - the API would provide a set of generic representation and response
> classes that use the fine-grained annotations for common scenarios
> like issuing a redirect.
>
> E.g. the current TemporaryRedirect class would become something like:
>
> public class TemporaryRedirect extends HttpResponse {
>
> ...
>
> @RepresentationLocation
> public URI getLocation() {...}
> }
>
> But any user-defined class could also set the location header using
> the annotation, the TemporaryRedirect class would be a convenience
> class for those that don't want to define their own (the majority I
> suspect).
>
> Marc.
>
> ---
> Marc Hadley <marc.hadley at sun.com>
> CTO Office, Sun Microsystems.