• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

A proble writing byte array to client in JSP

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I have a problem when i try to write a byte array to the browser as an attachment, i use the method response.getOutputStream to get the binary stream for write in client but when it's writing the file corrupts when find a byte '00' and the file don't download well, i hope that someone there was have the same problem and can help me.
Thanks to all,
PD: the verion of Weblogic is 5.1 with service pack 10, and i use the method response.setContentType() and response.setHeader() to establish the proper file type
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You really should not output binary stuff from a jsp - it will get corrupted with text (assumed html) in the jsp file itself.
Output from a jsp should only go thru the JspWriter.
Write a servlet.
reply
    Bookmark Topic Watch Topic
  • New Topic