cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ganesh <sourubb...@gmail.com>
Subject Ajax form submit for Maultipart contetnt type along with other form fields
Date Fri, 23 Mar 2012 14:07:21 GMT
Hi All,

The requirements is to post the the form data along with the image/flash
file upload via AJAX sumbit.

In the server side we used @Consume("multipart/form-data") and the API
argument is org.apache.cxf.jaxrs.ext.multipart.MultipartBody

When we do a AJAX submit along with file upload everything is working fine.
We have a use case to submit the form without file upload. when we do the
AJAX sumbit without file upload the request content type is
"application/x-www-form-urlencoded" and in the server side we are getting
the below exception

[org.apache.cxf.jaxrs.utils.JAXRSUtils] .No operation matching request path
/ is found, HTTP Method : POST, ContentType :
application/x-www-form-urlencoded;charset=UTF-8, Accept :
application/json,text/javascript,*/*,.
2012-03-22 21:46:27,596 WARN 
[org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper]
WebApplicationException has been caught : no cause is available

We tried to add  @Consume("application/x-www-form-urlencoded") in the server
side, but still we faced the same issue.

In one of the thread we found to use org.apache.cxf.jaxrs.ext.RequestHandler
to set the content type explicitly in the server side.

Could you please tell us whether can we follow the above approach or any
other solution to resolve the issue.

Regards,
Ganesh

--
View this message in context: http://cxf.547215.n5.nabble.com/Ajax-form-submit-for-Maultipart-contetnt-type-along-with-other-form-fields-tp5589560p5589560.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Mime
View raw message