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

Update FormEncodingProvider to support org.apache.cxf.jaxrs.ext.form.Form

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.4, 2.3.4
    • JAX-RS
    • None

    Description

      Minor syntactical change, but would allow us to code per-Form object, like Jersey here:

      @Produces("application/x-www-form-urlencoded")
      @GET
      public Form getFormURLEncodedRep(

      @PathParam("arg1")String arg1,
      @PathParam("arg2")String arg2)

      { Form urlProps = new Form(); urlProps.add("representation", "FormURLEncodedRepresentation"); urlProps.add("name", "Master Duke"); urlProps.add("sex", "male"); urlProps.add("arg1", arg1); urlProps.add("arg2", arg2); return urlProps; }

      instead of the present MetadataMap (with CXF):

      @Produces("application/x-www-form-urlencoded")
      @GET
      public MultivaluedMap<String, String> getFormURLEncodedRep(
      @PathParam("arg1")String arg1,
      @PathParam("arg2")String arg2) {
      MultivaluedMap<String, String> urlProps = new MetadataMap<String, String>();
      urlProps.add("representation", "FormURLEncodedRepresentation");
      urlProps.add("name", "Master Duke");
      urlProps.add("sex", "male");
      urlProps.add("arg1", arg1);
      urlProps.add("arg2", arg2);
      return urlProps;
      }

      See conversion note #8 here: http://www.jroller.com/gmazza/entry/jersey_samples_on_cxf

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            gmazza Glen Mazza
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: