From: Ryan J. M. <ry...@da...> - 2008-03-15 19:02:12
|
In one of the initial versions of RESTEasy (some code I never apparently committed) I did have a RepresentationHandler for "multipart/form-data" and it worked out okay. The only down side was your method ended up looking something like this: @ConsumeMime("multipart/form-data") public Object post(MimeMultipart muliPart) { Order order = MultipartHelper.unmarshallPart( mp.getBodyPart(0),Order.class); ... Not the most elegant solution, but it should be able to work within guidelines of JAX-RS. On the other hand, it maybe nice to do something more like: @ConsumeMime("multipart/form-data") public Object post(@MultiPartParam(name="order",type = "application/ order+xml") Order order) { ... In this case, we'd push all of the processing logic to RESTEasy and the let the developer work with order element directly. However, I'm not sure if the processing logic would conflict with JAX-RS. I'm trying to play catch up on the spec as I got a bit rusty over the past few months. The MessageReader/Writer stuff is a bit new to me. I'm curious to hear any opinions. Ryan- |