Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] JavaOne Async IO presentation

Jarym,

Glad you liked the presentation.

I've not put much though to how to structure async multipart upload, but my guess would be to avoid doing any readline like operations.

Instead, I would look to write a parser that worked of byte arrays and just parsed the header as it went and then seamlessly switches into byte mode for the body.

The Jetty HttpParser is going to be pretty close to what you need for a start.   It is rather complex, as HTTP is more complex than most realise, but it is pretty much the same as a mime header.

So I would consider starting with that and making an async multipart parser in a similar style.

cheers









On 7 October 2014 07:35, Jarym <emrul.i@xxxxxxxxx> wrote:
I just wanted to say thank you for sharing these slides.  Most of the really
useful Servlet 3.1 information appears to come from the Jetty team.

I've been trying to handle Async file uploads and I haven't found a servlet
example to work off of.  Since my clients will be web-browsers posting via
HTML forms I realise I have to handle multi-part requests and that the
current Jetty implementation of multipart doesn't support asynchronous
operation (it seems to load the entire HTTP request and then parse it).

The Grizzly team have created an async multipart component here:
https://grizzly.java.net/httpserverframeworkextras.html - I like the
approach although for my own implementation I would like to be able to set a
File Part handler at a later point in my code (so read all the form-data
chunks and then halt reading if I get a chunk with a filename until some
type of file-handler is attached).

I'm about to attempt to code what I need for Jetty but am facing some
stumbling blocks (like how best to do a readLine without reading in all the
byte content).  Can anyone offer some pointers on how I should go about
doing this (and whether there's example code I can draw inspiration from)?



--
View this message in context: http://jetty.4.x6.nabble.com/jetty-dev-JavaOne-Async-IO-presentation-tp4963158p4963195.html
Sent from the Jetty Dev mailing list archive at Nabble.com.
_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev


Back to the top