You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Barry Fitzgerald (JIRA)" <ji...@apache.org> on 2008/02/13 13:16:08 UTC

[jira] Created: (CXF-1431) Error in the JAX-RS implementation for matching method types to Accept Header

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.


[jira] Assigned: (CXF-1431) Error in the JAX-RS implementation for matching method types to Accept Header

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1431?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp reassigned CXF-1431:
--------------------------------

    Assignee:     (was: Daniel Kulp)

> 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.


[jira] Commented: (CXF-1431) Error in the JAX-RS implementation for matching method types to Accept Header

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571386#action_12571386 ] 

Sergey Beryozkin commented on CXF-1431:
---------------------------------------

Will be fixed as part of CXF-1415

> 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.


[jira] Commented: (CXF-1431) Error in the JAX-RS implementation for matching method types to Accept Header

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12573647#action_12573647 ] 

Sergey Beryozkin commented on CXF-1431:
---------------------------------------

Barry, we're ready to close this JIRA, can you please independently verify that this issue has been fixed for you ?



> 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.


[jira] Commented: (CXF-1431) Error in the JAX-RS implementation for matching method types to Accept Header

Posted by "Barry Fitzgerald (JIRA)" <ji...@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.


[jira] Assigned: (CXF-1431) Error in the JAX-RS implementation for matching method types to Accept Header

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1431?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp reassigned CXF-1431:
--------------------------------

    Assignee: Daniel Kulp

> 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
>            Assignee: Daniel Kulp
>             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.


[jira] Resolved: (CXF-1431) Error in the JAX-RS implementation for matching method types to Accept Header

Posted by "Daniel Kulp (JIRA)" <ji...@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.