Return-Path: Delivered-To: apmail-incubator-cxf-issues-archive@locus.apache.org Received: (qmail 63810 invoked from network); 3 Mar 2008 14:47:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Mar 2008 14:47:57 -0000 Received: (qmail 41720 invoked by uid 500); 3 Mar 2008 14:47:53 -0000 Delivered-To: apmail-incubator-cxf-issues-archive@incubator.apache.org Received: (qmail 41641 invoked by uid 500); 3 Mar 2008 14:47:53 -0000 Mailing-List: contact cxf-issues-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-issues@incubator.apache.org Received: (qmail 41632 invoked by uid 99); 3 Mar 2008 14:47:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2008 06:47:53 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2008 14:47:26 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 23430234C08B for ; Mon, 3 Mar 2008 06:46:51 -0800 (PST) Message-ID: <1910118960.1204555611142.JavaMail.jira@brutus> Date: Mon, 3 Mar 2008 06:46:51 -0800 (PST) From: "Daniel Kulp (JIRA)" To: cxf-issues@incubator.apache.org Subject: [jira] Resolved: (CXF-1431) Error in the JAX-RS implementation for matching method types to Accept Header In-Reply-To: <4988816.1202904968574.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-1431?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Kulp resolved CXF-1431. ------------------------------ Resolution: Fixed > Error in the JAX-RS implementation for matching method types to Accept Header > ----------------------------------------------------------------------------- > > Key: CXF-1431 > URL: https://issues.apache.org/jira/browse/CXF-1431 > Project: CXF > Issue Type: Bug > Components: REST > Affects Versions: 2.1 > Reporter: Barry Fitzgerald > Fix For: 2.1 > > > Consider the following scenario: > I have a resource with 2 methods: > @HttpMethod("GET") > @UriTemplate("/users/{id}") > @ProduceMime("text/xml") > public Response getUser(@UriParam("id") String id) throws Exception { ....} > @HttpMethod("GET") > @UriTemplate("/users/{id}") > @ProduceMime("application/json") > public Response getUserJSON(@UriParam("id") String id) throws Exception { ....} > If I then send a request to /users/24 with Accept headers of "text/xml, */*" one would expect the "text/xml" method to be invoked. However in the CXF implementation the application/json one is invoked. Suggest changing the algorithm to: > 1. Sort the Accept header according to the W3 standards > 2. Iterate through the accept header list. For each one: > 1. Find all matching methods > 2. If there is only one method return this and break out of the accept header loop > 3. If there are multiple methods sort these methods using consume mime and produce mime. Then return the first -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.