Bonjour Jerome,
I couldn't take a look until now (I was correcting exams all day
long). What I've realized is that I just needed to change the
signature of my method from:
@PropFind
public Representation propfind(Representation entity) throws ResourceException
to:
@PropFind("xml")
public Representation propfind(Representation entity) throws ResourceException
I can also change my PropFind annotation implementation like this:
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Method("PROPFIND")
public @interface PropFind {
String value() default "xml"; // Formerly this was the empty String
}
So I can avoid specifying "xml" explicitly in the annotated method
(after all, XML is the media type of a WebDAV request body) and keep
my former method signature.
So, I've changed all my WebDAV annotations (PropFind, Lock, Unlock) to
have "xml" as default value, and all looks to work fine.
I've noticed many people complained about HTTP 405 with their (already
working with 2.0RC4, or any other pre-2.0.0) code after the switch to
either 2.0.0 or 2.0.1, and indeed there seem to have been major
changes in the content-negotiation/method routing/conversion services
handling on Restlet, which require to specify some things more
explicitly on the annotated resource classes.
Maybe all this can be documented somewhere? This kind of 'breaking'
changes from an RC version to a final version can be a bit annoying
sometimes...
It wouldn't hurt if Thierry can take a look (I've drowned while diving
on the restlet source code files :-)) anyway to make sure this is not
broken again in 2.0.2.
Thanks again for your continued support and for the Excellent Restlet libs.
On Mon, Oct 4, 2010 at 2:50 PM, Jerome Louvel <[email protected]> wrote:
> Hi Fabian,
>
> If you can help us with a patch that would be welcome. Otherwise, Thierry
> will try to take a look at this issue on Wednesday.
>
> This should really be fixed for 2.0.2 which is scheduled for mid-October,
> along with 2.1 M1. At this point, 2.0.2 will be tagged as 'stable' and 2.1 M1
> as 'testing'.
>
> Best regards,
> Jerome
> --
> Restlet ~ Founder and Technical Lead ~ http://www.restlet.org
> Noelios Technologies ~ http://www.noelios.com
>
> -----Message d'origine-----
> De : Fabian Mandelbaum [mailto:[email protected]]
> Envoyé : lundi 4 octobre 2010 15:59
> À : [email protected]
> Objet : Re: Re: Re: Re: PROPFIND doesn't work anymore after the switch from
> 2.0RC4 to 2.0.0
>
> Hello Thierry,
>
> sadly I have to "refloat" this bug on Restlet 2.0.1. I'm using Restlet
> 2.0.1 SE and PROPFIND is not handled anymore. I've switched libs back to
> 2.0.0 ones (which have other problems, so I cannot use 'em as a
> 'fix') and PROPFIND is handled properly. I switch back to 2.0.1 libs and
> PROPFIND is never handled.
>
> The method's signature is this one:
>
> @Propfind
> public Representation propfind(Representation entity) throws ResourceException
>
> and it's never called with 2.0.1 libs, while it's properly called with
> 2.0.0 libs.
>
> So, it seems that 2.0.1 re-introduced the converter service bug avoiding
> proper handling of PROPFIND (and possibly other non-HTTP methods).
>
> Thanks in advance for fixing it for a possible release of a 2.0.2 version of
> restlet (will there be any? when?)
>
> On Wed, Sep 8, 2010 at 5:53 AM, Thierry Boileau <[email protected]>
> wrote:
>> Hello Fabian,
>>
>>
>>>So I guess I can just ommit the final DomRepresentation ... line.
>> Actually, as you need to access the DOM nodes, you still have to wrap the
>> given instance of InputRepresentation.
>> And as you rely on the XML extension, which provides is own converter, I
>> think you can try :
>> public Representation propfind(DomRepresentation reqrep) throws
>> ResourceException { }
>>
>>>Maybe the empty parameters signature is confusing the content negotiation
>>>logic for the annotated method handler somehow?
>> Yes, this is the point. When using annotations which rely on an entity, it's
>> warmly recommended (and even mandatory) to have a parameter in the annotated
>> java method.
>>
>> Best regards,
>> Thierry Boileau
>>
>> ------------------------------------------------------
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId
>> =2656741
>>
>
>
>
> --
> Fabián Mandelbaum
> IS Engineer
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2667825
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2667877
>
--
Fabián Mandelbaum
IS Engineer
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2668358