Return-Path: Delivered-To: apmail-incubator-cxf-issues-archive@locus.apache.org Received: (qmail 70001 invoked from network); 3 Mar 2008 11:54:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Mar 2008 11:54:02 -0000 Received: (qmail 75257 invoked by uid 500); 3 Mar 2008 11:53:56 -0000 Delivered-To: apmail-incubator-cxf-issues-archive@incubator.apache.org Received: (qmail 74957 invoked by uid 500); 3 Mar 2008 11:53:55 -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 74927 invoked by uid 99); 3 Mar 2008 11:53:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2008 03:53:55 -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 11:53:16 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5BD9C234C05C for ; Mon, 3 Mar 2008 03:52:51 -0800 (PST) Message-ID: <1727642475.1204545171366.JavaMail.jira@brutus> Date: Mon, 3 Mar 2008 03:52:51 -0800 (PST) From: "Barry Fitzgerald (JIRA)" To: cxf-issues@incubator.apache.org Subject: [jira] Commented: (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:comment-tabpanel&focusedCommentId=12574450#action_12574450 ] Barry Fitzgerald commented on CXF-1431: --------------------------------------- Confirmed fix > 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.