• 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

Using JFileChooser in a webapplication

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I need to use JFileChooser in my web-application, any help will be deeply
appropriated.
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You didn’t say what you know about file choosers already, so I shall give you a Java tutorials link.
 
sadanand munswamy
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Campbell Ritchie,
I have been doing java for a long time, So i do know it.
Some how i need to invoke a file chooser from my web-application that should allow
the user to choose only directory and no files.
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can only use a JFileChooser in combination with an applet. Because of the applet's security restrictions, it needs to be signed first.

The important question is, however, why you need to let users select a directory. Using a JFileChooser would let the user choose a local directory where the server has no access to (other than through the applet, but only while the applet is active). Is that what you want? Or do you want the user to select a directory on the server? In that case, perhaps you can build some HTML based file browser yourself (or find some existing code to do that). Make sure that the user cannot select just any directory; keep the selection as limited as possible.
 
sadanand munswamy
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Rob,
Thanks for your valuable insights, And you are absolutely correct, as i need to choose any directory
from the server and not the local. Is there any read to use html file chooser, which can do the trick for me.
Thanks Again.
 
Rob Spoor
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out http://stackoverflow.com/questions/9068156/server-side-file-browsing. You may need to tweak it a bit to get it to show only directories.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic