Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Multipart Servlet in RAP
Multipart Servlet in RAP [message #1791075] Fri, 22 June 2018 11:33 Go to next message
Andrea Antonello is currently offline Andrea AntonelloFriend
Messages: 6
Registered: June 2015
Junior Member
Hi,
I am trying to figure out how to configure a servlet in a RAP application that runs through Jetty embedded in Equinox.

I am using the org.eclipse.equinox.http.registry.servlets extension poitn for the servlet, but found no way to configure it for multipart posts.

The only way suggested me has been to use apache's ServletFileUpload class to parse the body as multipart. It works but seems a bit an odd way to do it.

Is this the way to go or is there a better way?

Thank you,
Andrea
Re: Multipart Servlet in RAP [message #1791077 is a reply to message #1791075] Fri, 22 June 2018 12:09 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2285
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
there are two ways to handle the multipart upload. The old servlet 2.x way with apache fileupload bundle as you already discovered and the new servlet 3.1 way by adding MultipartConfig annotation to your servlet. Here is an example [1]. With the new 3.1 API you cant really track the upload progress because you have access the the request (in your servlet) after the request is fully processed/parsed.

[1] https://github.com/jetty-project/multipartconfig-example/blob/master/src/main/java/com/example/UploadServlet.java

HTH,
Ivan
Re: Multipart Servlet in RAP [message #1791081 is a reply to message #1791077] Fri, 22 June 2018 13:57 Go to previous message
Andrea Antonello is currently offline Andrea AntonelloFriend
Messages: 6
Registered: June 2015
Junior Member
Thank you for the reply Ivan.
I had stumbled on this during my desperate search for a solution.

I have indeed tried to use the annotations you mention and seen in the example, but the result is always the same for me. An exception telling me that:

java.io.IOException: Servlet not configured for multipart!

Since you mention it though, I now know it should work, so I will try to see if I have issues with the dependencies, though I am quite sure that the servlet packages are of version >= 3.1.

Thank you.
Andrea
Previous Topic:Strange Resize-Event in a Sash
Next Topic:[ANN] RAP 3.5 released
Goto Forum:
  


Current Time: Tue Sep 25 00:53:44 GMT 2018

Powered by FUDForum. Page generated in 0.01727 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top