tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Comet and multipart
Date Thu, 06 Jan 2011 15:43:18 GMT
sol myr wrote:
> Thanks :)
> You're correct about blocking inputStreams, but I actually need Tomcat to write a multipart
*response*, on an OutputStream (the reading side is on the client, and our client-side programmers
will manage it without blocking).
> I wondered whether I'll have to hand-code it (manually output the headers, etc), or is
there some utilities on Tomcat/apach.
Depending on what you need precisely, you may want to have a look at stuff available in 
the "java mail" part.  That should have code re-usable to construct a MIME multi-part body.
Another place to look would be the Apache HttpClient code.  In principle, it is used to 
build multi-part *requests*, but the code can probably be re-used too.

There are things like these which simplify life :

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.multipart.FilePart;
import org.apache.commons.httpclient.methods.multipart.StringPart;
import org.apache.commons.httpclient.methods.multipart.PartBase;
import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;
import org.apache.commons.httpclient.methods.multipart.Part;

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message