camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From navaltiger <>
Subject Multipart form data and servlet/restlet endpoint
Date Wed, 12 Nov 2014 04:21:48 GMT
dear all,

I am looking to implement a route where reslet/cxfrs end point will accept
file as multipart request and process. (Request may have some JSON data as

For sake of simplify thing and get it working with servlet first have tried
following code.  Also tried sending file using curl. I can see file related
info in headers and debug output, but not able to retrieve attachment. But
no luck. 
(Additional info: I am running project as mvn jetty:run.  The package is in
form of war and will be deployed on web logic server.  Moreover, stream
caching is not in place.)

from("servlet:///hello").process(new Processor() {
   public void process(Exchange exchange) throws Exception {
      Message in = exchange.getIn();
      StringBuffer v = new StringBuffer();
       HttpServletRequest request = (HttpServletRequest) in

       DiskFileItemFactory diskFile = new DiskFileItemFactory();
       FileItemFactory factory = diskFile;
       ServletFileUpload upload = new ServletFileUpload(factory);
       List items = upload.parseRequest(request);

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message