dev@jsr311.java.net

Re: Redirection and creation

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 13 Apr 2007 15:17:37 -0400

On Apr 13, 2007, at 1:21 PM, Jerome Louvel wrote:
>
> 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.
>
Sure, I'll also try to roll in some of the feedback received so far
and post some updated javadocs early next week.

Marc.

>
>> -----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.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: dev-help_at_jsr311.dev.java.net
>

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.