File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Download files component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Download files component" Watch "Download files component" New topic
Author

Download files component

Mary Cole
Ranch Hand

Joined: Dec 02, 2000
Posts: 362
Hi,
Is there a component/sample code to download files from a web page using JSF?

Please advice
Jason Lee
Greenhorn

Joined: Mar 03, 2008
Posts: 12
Originally posted by Mary Cole:
Hi,
Is there a component/sample code to download files from a web page using JSF?

Please advice


Off hand, assuming I understand your request, I know of two such components. One is my own download component in the Mojarra Scales project: https://scales.dev.java.net/#download with a live demo here: http://jsftemplating.org/mojarra-scales-demo-facelets/download.jsf

RichFaces/Ajax4Jsf also offers a4j:mediaOutput: http://labs.jboss.org/file-access/default/members/jbossrichfaces/freezone/docs/devguide/en/html/RichFacesComponentsLibrary.html (section 6.12) and a live demo of that here: http://livedemo.exadel.com/richfaces-demo/richfaces/mediaOutput.jsf


Jason Lee, SCJP
Senior Member of Technical Staff with Oracle
http://blogs.steeplesoft.com
Mary Cole
Ranch Hand

Joined: Dec 02, 2000
Posts: 362
I didn't get much info from both the sites...actually, I have a filename (.pl or .zip , or .doc) with a hyperlink ( a command link ) to it on the web page..on click of the link, it should call the method on the bean to get the file contents and display the save open dialog box so that the user can view or downlad the file.. if possible I would prefer not to refresh the page..Ajaxit

any suggestions?

[ March 25, 2008: Message edited by: Mary Cole ]
[ March 25, 2008: Message edited by: Mary Cole ]
Ketan Jambhekar
Ranch Hand

Joined: Mar 26, 2007
Posts: 37
Hi,
i dont think you need any special components to acheive this functionality.
You can use the link as a commandLink and call a method which does the following


You need to write your own custom methods whereever applicable in the above scenario.

Thanks,
Ketan.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Download files component
 
Similar Threads
Not able to compile servlet
how can i send email without email account
downloading a file from server
Upload and Download file to https
Suggestions for displaying files from database