jQuery in Action, 3rd edition
The moose likes JSF and the fly likes Directory Chooser  on JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Directory Chooser  on JSF" Watch "Directory Chooser  on JSF" New topic

Directory Chooser on JSF

Mc. Alvin Bautista

Joined: Jul 17, 2006
Posts: 10

Is there anyone here who knows how to create a Directory Chooser in JSF or on jsp page?
It is a dialog box where you can select a directory and it will display
on the textfield the selected path.

Example path - > c:\Program Files\Adobe

I searched the internet but I haven't found anything about this Directory Chooser on JSF. There is a JDialogChooser but I think it is not applicable for my application because it is just for Java Application and not for Web Application. Is anyone here who knows how to implement this thing on web? Thanks.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

First off, realize the difference between a client and a server. Although URLs may look similar to file paths, they're not. Having http access to a web server doesn't give you access to the filesystem on that machine. That requires a file server.

On the client side, web browsers are restricted in their abilities to access local resources. That's the only reason that the web is even as safe as it is. Under a normal setup, the only way you're going to get a file browser from a webapp is if the web page contains a file up/download component. In that case, you will be presented a file chooser popup that allows you to specify where the file that you're up- or downloading to the server is located on your local machine.

You have no option as to where (or if) an uploaded file will go if you send it to a web server. The server application controls that. If a server application wants to take your file named c:\My Documents\alldata.txt and store only the odd-numbered lines as elements in a database, an webapp can be written to do just that. Likewise, a web server can generate data on the fly that would download to your computer. I often create downloadable PDFs that way.

An IDE is no substitute for an Intelligent Developer.
Mc. Alvin Bautista

Joined: Jul 17, 2006
Posts: 10
Thanks Tim, so it means, it is impossible to create the Directory Chooser on the web. Therefore, there is no other option but to type the folder path in the textfield. Am i right? Because the user can't open the Directory Chooser Dialog Box. They have to type the whole folder path.
I agree. Here's the link: http://aspose.com/file-tools
subject: Directory Chooser on JSF
It's not a secret anymore!