Hi list,
I'm having problems with negotiation not working with my @Get("json") and
@Get("txt") annotated methods and couldn't understand why so I decided to
investigate.
I found that in ServerResource I end up at result = doHandle(); in
doNegotiatedHandle which if I understand is the case when negotiation can't
find any suitable annotated method/variant and it will just execute the default
method.
This happens because annotationInfo.isCompatible returns false so I looked into
AnnotationInfo.java and I can't understand how the logic in
isCompatibleRequestEntity could work right with annotated get methods which has
no input parameters.
Specifically isCompatibleRequestEntity will always result in false when the
method in question has no input parameters (getRequestVariants returns null)
and so will return false. But @Get annotated methods naturally has no
parameters so I don't understand how this logic can work?
It seems unlikely that I'm correct since this case can't be uncommon... so
perhaps I'm reading the code all wrong, but if that's the case any
clarification would hopefully help me.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2651378