I'm currently using the @Form functionality to handle the
unmarshalling of form data sent via a cross-domain ajax post

 @Path("/add")
 @POST
 @Produces("application/json")
 @Consumes("application/x-www-form-urlencoded")
 public Response add(@Form MyForm form) { ... }

This works great except for when coming from Internet Explorer which
has to be a XDomainRequest and that only supports sending with
content-type text/plain.

I can obviously create another method to handle this request which is
receiving valid form data just with the wrong content-type

@Path("/add")
@POST
@Produces("application/json")
@Consumes("text/plain")
public Response add(String data) { ... }

However at this point I have to manually parse the data and set it
field by field into my object.

1. Is there anyway to force the first method to process the the
request data regardless of the received content-type?

2. If that isn't possible, is there a way I can manually call an
internal RESTeasy function to map the String data from my second
method to a specified class with @FormParam variables.

Thanks!

-C

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users

Reply via email to