users@jersey.java.net

Re: [Jersey] Producing media type conflict

From: Cameron Heavon-Jones <cmhjones_at_gmail.com>
Date: Thu, 21 Oct 2010 13:09:15 +0100

Hi Imran,

Unfortunately the get() method is inherited from a parent class so i can't get rid of it, my example was a little sparse of actual usefulness! i think that i might have to collect the query terms explicitly instead of using the annotations.

Thanks,
Cam

On 21/10/2010, at 4:46 AM, Imran M Yousuf wrote:

> Hi Cam,
>
> How about just using -
> @GET
> public Response get(@QueryParam("term") @DefaultValue("") String term) {
> return Response.ok().build();
> }
>
> It would result to the same as what you are using.
>
> Regards,
>
> Imran
>
> On Thu, Oct 21, 2010 at 2:15 AM, Cameron Heavon-Jones
> <cmhjones_at_gmail.com> 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")
>> 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
>>
>>
>
>
>
> --
> Imran M Yousuf
> Entrepreneur & CEO
> Smart IT Engineering Ltd.
> 25/5B, Block F, Haji Chinu Miah Road Bylane
> Joint Quarter, Mohammadpur
> Dhaka - 1207, Bangladesh
> Email: imran_at_smartitengineering.com
> Twitter: @imyousuf - http://twitter.com/imyousuf
> Blog: http://imyousuf-tech.blogs.smartitengineering.com/
> Mobile: +880-1711402557
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>