cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neal Hu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-6941) Send Comma Separated Array in uril request
Date Tue, 21 Jun 2016 12:24:57 GMT

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

Neal Hu commented on CXF-6941:
------------------------------

Sergey,

Sending multiple parameters with the same name to Spring MVC without problem. The Spring MVC
can parse name=Actor1,Actor2,Actor3 or name=Actor1&name=Actor2&name=Actor3. But CXF
jaxrs only support name=Actor1&name=Actor2&name=Actor3.

Thus if we have such client request name=Actor1,Actor2,Actor3, talking to Spring MVC without
issue, but moved to cxf jaxrs can not work.  

We can detect the type when injecting @QueryParam("name") String[]. 

Neal

> Send Comma Separated Array in uril request
> ------------------------------------------
>
>                 Key: CXF-6941
>                 URL: https://issues.apache.org/jira/browse/CXF-6941
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-RS
>    Affects Versions: 3.1.6
>         Environment: Mac
>            Reporter: Neal Hu
>             Fix For: 3.2.0, 3.1.8
>
>
> http://stackoverflow.com/questions/11889997/how-to-send-a-array-in-url-request
> Spring MVC and PHP support send comma separated array in the url request:
> http://localhost:8080/MovieDB/GetJson?name=Actor1,Actor2,Actor3&startDate=20120101&endDate=20120505
> @RequestMapping(value = "/GetJson", method = RequestMethod.GET) 
> public void getJson(@RequestParam("name") String[] ticker, @RequestParam("startDate")
String startDate, @RequestParam("endDate") String endDate) {
>    //code to get results from db for those params.
>  }
> Now jax-rs only support below:
> http://localhost:8080/JerseyPojo/jaxrs/BasicResource/test?nameList=xx&nameList=xxx&nameList=ddd
> @Path("/test")
>     @GET
>     public String getQueryList([~getadroit@gmail.com]
> When we migrate from Spring MVC to jax-rs, found problem.
> Neal



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message