users@jersey.java.net

Re: [Jersey] SEE OTHER response status question...

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Thu, 21 May 2009 11:39:35 -0400

Good catch. That's a Javadoc bug, the constant has the right value
fortunately.

Marc.

On May 21, 2009, at 10:44 AM, Rabick, Mark A (IS) wrote:

> Thanks Marc. I was looking at the JSR311 apidocs in the Jersey 1.0.3
> archive:
>
> jersey-archive-1.0.3/apidocs/jsr311/index.html
>
> I just didn't see the SEE OTHER because the doc for
> Response.Status.MOVED_PERMANENTLY lists 303
>
> (same at this link:
> https://jsr311.dev.java.net/nonav/releases/1.0/javax/ws/rs/core/Response
> .Status.html
>
> MOVED_PERMANENTLY
> 303 See Other, see HTTP/1.1 documentation.
>
> SEE_OTHER
> 303 See Other, see HTTP/1.1 documentation.
>
> MOVED_PERMANENTLY should be 301???
>
> --mark
>
> _______________________________________________
> Mark A. Rabick - Software Engineer
> Em: mark.rabick_at_ngc.com
>
>
>
>> -----Original Message-----
>> From: Marc.Hadley_at_Sun.COM [mailto:Marc.Hadley_at_Sun.COM]
>> Sent: Wednesday, May 20, 2009 3:36 PM
>> To: users_at_jersey.dev.java.net
>> Subject: Re: [Jersey] SEE OTHER response status question...
>>
>> On May 20, 2009, at 4:22 PM, Rabick, Mark A (IS) wrote:
>>
>>> I have an object that contains another object:
>>>
>>> Public class Node {
>>> public String id;
>>> public Map map;
>>> // more stuff...
>>> }
>>>
>>> Public class Map {
>>> public string id;
>>> // more stuff...
>>> }
>>>
>>> Lets say I have Node {id=1111; Map map {id=xxxx}}
>>>
>>> That is, the embedded Map is {id=xxxx}
>>>
>>> I have top-level resources for each independent entity:
>>>
>>> /nodes/{nodeId}
>>> /maps/{mapId}
>>>
>>> I have extended the /nodes URI:
>>>
>>> /nodes/{nodeId}/map
>>>
>>> Which I currently have returning a response with status code 300
>>> (Multiple Choices) that puts the addressable URI for the map in the
>>> Location header:
>>>
>>> /nodes/1111 // returns the Node
>>> /maps/xxxx // returns the Map
>>>
>>> /nodes/1111/map
>>>
>>> Returns:
>>> Status: 300
>>> Location: /maps/xxxx
>>>
>>> It basically gives me the URI of the Map for a given Node.
>> I was just
>>> looking at the HTTP/1.1 spec and found
>>>
>>> 303 See Other
>>>
>>> I think this is the better status because I only have 1 choice.
>>> It's basically a redirect. 303/See Other is not available in
>>>
>>> javax.ws.rs.core.Response.Status
>>>
>>
>> Here it is:
>> https://jsr311.dev.java.net/nonav/releases/1.0/javax/ws/rs/cor
>> e/Response.Status.html
>> #SEE_OTHER
>>
>> and here:
>>
>> https://jsr311.dev.java.net/nonav/releases/1.0/javax/ws/rs/cor
>> e/Response.html
>> #seeOther(java.net.URI)
>>
>>>
>>> or
>>> Com.sun.jersey.api.Responses
>>>
>>> Questions:
>>> 1. Is See Other the best option to use for my redirect situation?
>>>
>>
>> It looks like a good choice to me.
>>>
>>> 2. Any reason all HTTP/1.1 status codes are not included in
>> the enums?
>>>
>>
>> We didn't include the less useful ones to avoid cluttering
>> the API unnecessarily. IIRC, we included those listed as
>> medium or above importance in the RESTful Web Services book.
>>
>> Marc.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>