cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-5562) value of @QueryParam/@PathParam Annotation inside @BeanParam Classes will be ignored
Date Thu, 13 Feb 2014 13:54:19 GMT

    [ https://issues.apache.org/jira/browse/CXF-5562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13900345#comment-13900345
] 

Sergey Beryozkin commented on CXF-5562:
---------------------------------------

Then simply use WebClient or new Cleint API and set the query options as needed;

Cheers, Sergey

> value of @QueryParam/@PathParam Annotation inside @BeanParam Classes will be ignored
> ------------------------------------------------------------------------------------
>
>                 Key: CXF-5562
>                 URL: https://issues.apache.org/jira/browse/CXF-5562
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.7.10
>         Environment: Oracle JDK 1.7.51
>            Reporter: Edgar Wentzlaff
>
> Value of @QueryParam/@PathParam Annotation inside @BeanParam Classes will be ignored
by the JAXRS-Client.
> TestCase:
> {code:title=cxf-2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java}
> //...
>     @Test
>     public void testProxyBeanParam() throws Exception {
>         BookStore store = JAXRSClientFactory.create("http://localhost:" + PORT, BookStore.class);
>         BookStore.BookBean bean = new BookStore.BookBean();
>         bean.setId(100L);
>         bean.setId2(23L);
>                 
>         Book book = store.getBeanParamBook(bean);
>         assertEquals(123L, book.getId());
>         
>     }
> //...
> {code}
> Modified BookStore.BookBean inside Test Example
> {code:title=cxf-2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java}
> //...
>     public static class BookBean {
>         private long id;
>         private long id2;
>         private long id3;
>         public long getId() {
>             return id;
>         }
>         //@PathParam("id")
>         @PathParam("ID")
>         public void setId(long id) {
>             this.id = id;
>         }
>         
>         public long getId2() {
>             return id2;
>         }
>         //@QueryParam("id2")
>         @QueryParam("id_2")
>         public void setId2(long id2) {
>             this.id2 = id2;
>         }
>         
>         @Context
>         public void setUriInfo(UriInfo ui) {
>             String id3Value = ui.getQueryParameters().getFirst("id3");
>             if (id3Value != null) {
>                 this.id3 = Long.valueOf(id3Value);
>             }
>         }
>         public long getId3() {
>             return id3;
>         }
>         
>     }
> //...
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message