Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you'd like to experiment with XOP then you need to set an "mtom-enabled" property on CXF jaxrs endpoints and clients.
Please see JAXRSMultipartTest (testXopWebClient) and MultipartStore (addBookXop) for more details.

Multipart Filters

 

It is possible to intercept the attachment write or read process starting from CXF 3.1.12.

MultipartInputFilter and MultipartOutputFilter have been introduced. These filters can be used to modify the list of the attachments parts or customize some of the individual part's properties, example, replace the part input stream, etc.

These filters can be registered from JAX-RS 2.0 client or container request/response filters. MultipartInputFilter can be added to the list of the input filters which is identified by a "multipart.input.filters" property on the current CXF message. Likewise, MultipartOutputFilter can be added to the list of the output filters which is identified by a "multipart.output.filters" property on the current CXF message.

 

Note about Struts

If you are using CXF and Struts2 within the same application and expecting CXF to process multipart/form-data payloads then you need to make sure Struts2 dispatcher is not consuming the request input stream.

...