HI Benson

On Mon, Apr 25, 2011 at 5:54 PM, Benson Margulies <[email protected]> wrote:
> I'm using multipart/form-data to include a file upload, but there are
> some ordinary fields as well. Am I stuck with having them handled in
> Java as Attachments, or is there some way to get them bound to string
> params?
>

If you can use @Multipart annotation then try something like this:

public Response addFiles(@Multipart("owner") String name,
                                 @Multipart("files") List<Book> books) {}

alternatively, try having MultipartBody only in the signature and then do

public Response addFiles(MultipartBody body) {
    body.getAttachmentObject(contentId, String.class);
}

Note, only in CXF 2.3.4 Content-Disposition's 'name' parameter is also
 checked for body.getAttachmentObject(contentId, SomeClass.class); to
succeed, in earlier versions only Content-Id is checked

Does it help ? If not then send me a sample payload please

Cheers, Sergey

Reply via email to