• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I output a binary stream from JSP

 
C Vivek
Ranch Hand
Posts: 115
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
C Vivek
Ranch Hand
Posts: 115
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic