• 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

convert Bytes[] to StreamedContent fro download jsf2.0 primefaces3.3.1

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello
I use primefaces and I want to download a file with different formats(pdf, jpg, png, ) from database but I don't succed to realise this I have seen a lot of topic like this but their methods don't work for me here is the html :


and here is the java :

always, image.getContentType() return null and bytes.length not null

do you have any idea

thank you
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSF is designed to work with HTML, not PDF, MS-Word/Excel files or other non-HTML data.

Instead of trying to force JSF to output stuff it wasn't intended to output, you'll find it's cleaner to use a JSF h:outputLink element to reference a servlet URL. Let the servlet handle outputting the special-format data.
reply
    Bookmark Topic Watch Topic
  • New Topic