File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes How can I output a binary stream from JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How can I output a binary stream from JSP" Watch "How can I output a binary stream from JSP" New topic
Author

How can I output a binary stream from JSP

C Vivek
Ranch Hand

Joined: Oct 03, 2004
Posts: 115
Hello,

How can I output a binary stream using JSP?
I would like to create various links of downloadable PDF's!

Thanks
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

JSP is a very poor choice of technology for streaming binary data.
It's a templating language meant for building up textual output.
Most JSP compilers (Jasper included) will add their own characters to the output fouling up an binary data.

I've seen people get it to work but they usually have to jump through some hoops that result in difficult to read JSPs.

This is much easier done from a servlet.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
C Vivek
Ranch Hand

Joined: Oct 03, 2004
Posts: 115
Thanks Ben!
If I would like to create a set of links in my JSP for downloading a set of files say in PDF format. How do I communicate with the Servlet and activate the download? I would like to keep the JSP page active so other links can also be clicked simultaneously.

I dont want to redirect to a resource.
Many Thanks
Vivek
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I output a binary stream from JSP