This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Servlets and the fly likes outputting zip file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "outputting zip file " Watch "outputting zip file " New topic

outputting zip file

ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 214
Hi ....
i am new to file IO ... and
i want to output zip file containg one or more xml files in zip through servet

i am creating multiple JDOM Document objects and i need to put all files into ZIP ..

ServletOutputStream outX = res.getOutputStream();

// outX.write(); this method takes bytes as input i dont know how should i input my JDOM object to this method

anyidea ??

olivier dutranoit
Ranch Hand

Joined: Aug 20, 2011
Posts: 81

for creating zips, try using


I agree. Here's the link:
subject: outputting zip file
Similar Threads
Looking for correct data type to take in stream of xml
can some .zip files (not java classes) be included in WEB-INF/classes too ?
add zip or jars to classpath
JDOM alternative JAR file required
can't use reset on input stream?