On Oct 21, 2010, at 2:17 PM, Cameron Heavon-Jones wrote:
> Hi Paul,
>
> I just upgraded from Jersey 1.0.1.
>
> I understand the jax-rs spec doesn't include query parametre
> dispatching and probably for a good reason as i can see how it could
> get complicated.
>
> From this simple case tho, it does seem intuitive to be able to
> dispatch based on the presence or absence of a declared query
> parametre for resolution.
>
Please log an issue here:
https://jsr311.dev.java.net/
> Like i just posted to Imran, as the get() method is actually
> inherited and i can't get rid of it, i think i will just have to
> extract the query parametres from the uri manually in the overridden
> get().
>
> I guess i just stumbled across one of those few 'fortunate' bugs,
> shame you closed it down :)
>
As i said the functionality you expected never worked in the first
place. The @QueryParam on the resource method has always been ignored.
All Jersey was doing was dispatching to the first method it saw via
reflection (since for 1.0.1 it did not check for such conflicts).
Paul.
> cam
>
> On 21/10/2010, at 8:04 AM, Paul Sandoz wrote:
>
>> Hi Cam,
>>
>> What version did you upgrade from?
>>
>> On Oct 20, 2010, at 10:15 PM, Cameron Heavon-Jones wrote:
>>
>>> Hi,
>>>
>>> I've just upgraded to jersey 1.4 and i have some code which used
>>> to work now failing with the message that there is a conflict in
>>> the produced media type. The two methods differ in that one has a
>>> query term and the other doesn't, eg:
>>>
>>>
>>> @GET
>>> @Override
>>> public Response get() {
>>> return get("");
>>> }
>>>
>>> @GET
>>> @QueryParam("term")
>>
>> JAX-RS only dispatches based on the URI path with @Path, media
>> types with @Produces/_at_Consumes and the HTTP method. It does not
>> dispatch based on one or more query parameters. So the behavior you
>> expect would of never worked in the first place.
>>
>> I think you were using an early version of Jersey that did not
>> detect conflicting resource methods for the same HTTP method that
>> consume and/or produce the same media types.
>>
>> Paul.
>>
>>> public Response get(@QueryParam("term") String term) {
>>> return Response.ok().build();
>>> }
>>>
>>>
>>> I saw on a previous post[1] that this was related to subclassing
>>> but in my case both methods are in the same class and with a
>>> differentiator.
>>>
>>> Thanks,
>>> Cam
>>>
>>> [1]http://markmail.org/search/?q=list%3Anet.java.dev.jersey.users#query
>>> :list%3Anet.java.dev.jersey.users+page:1+mid:7tmzxnm6dsqh6iov+state:results
>>> ---------------------------------------------------------------------
>>> 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
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>