Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6941

Send Comma Separated Array in url request

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1.6
    • 3.1.8, 3.2.0
    • JAX-RS
    • None
    • Mac

    • Unknown

    Description

      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(@QueryParam("nameList") List<String> nameList) {
              return "name list is: " + nameList.size() + nameList.toString();
          }
      

      When we migrate from Spring MVC to jax-rs, found problem.

      Neal

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            nbqyqx@163.com Neal Hu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: