You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2014/02/13 14:16:19 UTC
[jira] [Commented] (CXF-5562) value of @QueryParam/@PathParam
Annotation inside @BeanParam Classes will be ignored
[ https://issues.apache.org/jira/browse/CXF-5562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13900305#comment-13900305 ]
Sergey Beryozkin commented on CXF-5562:
---------------------------------------
I think this issue is invalid - the server works in a case-sensitive mode, so you'd need to have a setID method for the runtime to init the bean properly, and I'm not sure why you expect a setter marked with "id_2" marked, it won;t work :-)
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)