Hi John,

You are right and I've updated the behavior in SVN trunk. Now, if
Resource.getRepresentation(Variant) returns 'null', the Resource.handleGet()
method returns a NOT_FOUND (404) status. 

Note that we already generate a 406 if no variant is acceptable for the
client but for the current special case, it seems that a 404 is a better
default status. 

In case a different status is preferred by the developer, the
Resource.handleGet will preserve it. It only changes it to 404 if no status
exists or if it is a success status.

Best regards,
Jerome  

> -----Message d'origine-----
> De : John D. Mitchell [mailto:[EMAIL PROTECTED] 
> Envoyé : mercredi 1 août 2007 18:09
> À : [email protected]
> Objet : Re: 404 from getRepresentation/handleGet?
> 
> On 8/1/07, John D. Mitchell <[EMAIL PROTECTED]> wrote:
> > On 7/26/07, Geoffrey Wiseman <[EMAIL PROTECTED]> wrote:
> [...]
> > > Actually, I'd be happy with this if Resource.handleGet() 
> treated a null from
> > > getRepresentation as a 404, but that might not work for all cases?
> >
> > Yes, I've been bitten by forgetting to set the status in the case of
> > returning null from getRepresentation().
> >
> > I'd suggest updating the JavaDocs to make this clear 
> (either way) and
> > to update example Part's 12 to show this clearly (either way) (e.g.,
> 
> Also, there's the question whether this should result in a 
> 404 or a 406 error.
> 
> Opinions?
> 
> Thanks,
> John

Reply via email to