This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSF and the fly likes Image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "Image" Watch "Image" New topic
Author

Image

Dura Hurtado
Ranch Hand

Joined: Feb 16, 2011
Posts: 120
Hi, this line of code <p:fileDownload value="org.primefaces.model.DefaultStreamedContent@16b122e" />

shows the next error;

java.lang.ClassCastException: java.lang.String cannot be cast to org.primefaces.model.StreamedContent
at org.primefaces.component.filedownload.FileDownloadActionListener.processAction(FileDownloadActionListener.java:50)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)

¿Any clue?

Thanks
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19720
    
  10

That's a String. You can't put a String there, you have to put something which is of the org.primefaces.model.StreamedContent type. That's what the error message says.

So don't put a String there. Put a StreamedContent thing there.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Image
 
It's not a secret anymore!