This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Directory Chooser on JSF

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

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.
 
Saloon Keeper
Posts: 25850
184
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
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.
 
Mc. Alvin Bautista
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic