Hi Richard,

I've just improved the Javadocs for the represent() method to explain more
precisely how it behaves by default. 

If you override it, you are indeed responsible for doing content negotiation
and calling represent(Variant) explicitely.

Best regards,
Jérôme Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com
 

-----Message d'origine-----
De : Richard Hoberman [mailto:[EMAIL PROTECTED] 
Envoyé : vendredi 10 octobre 2008 09:33
À : [email protected]
Objet : Re: [Solved] "The method specified in the request is not allowed for
the resource identified by the request URI"

Hi Thierry

My post was unfortunately unclear.  By 'newly created resources' I meant
a newly written subclass of Resource rather than a new representation.

Best regards

Richard

Thierry Boileau wrote:
> Hello Richard,
>
> I just wonder what is your use case. I wonder if your problem is that
> your resource supports the add of new representation (via PUT request)
> but does not declare properly the varying list of supported variants.
> If I undestand, you have a Resource class attached to a certain URI.
> In this class, you have declared a list of possible variants (maybe
> empty).
> Then after a PUT request, a new representation of the resource has
> been provided which introduces a new variant that is not properly
> declared.
> Is that what you are experiencing?
>
>
> Best regards,
> Thierry Boileau
> --
> Restlet ~ Core developer ~ http://www.restlet.org
> <http://www.restlet.org/>
> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
> <http://www.noelios.com/>
>
>
>
>> If you are getting a 404 on a newly created resources, you may have
>> overridden
>>
>> public Representation represent()
>>
>> instead of the overloaded
>>
>> public Representation represent(Variant variant)
>>
>> (the difference being the variant argument).
>>
>> The Resource class calls the overloaded version, which will return a
>> null representation if you haven't overridden it.
>>
>> I spent quite a bit of time debugging this so this a heads up for others.
>>
>> Richard Hoberman

Reply via email to