• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

File Chooser

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the action method of the application, I want to pop a menu browser and that user can choose the directory which he wan to save the file.

however, when i created the filedialog or jfilechooser, the filechoose browser stays behind the browser(firefox,IE)

How can I pop a filechoose browser and force user to select a directory.

Or something like that...
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you trying to use Swing components in a web app?!
 
Sheriff
Posts: 27235
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which "file" is this which the user is saving? Is it an upload or a download?
 
pamir sonmez
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok, let me clarify to the situation

In the jsp page,

I submitted the button createReport and this method called the action method

public ActionForward createReport(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) {
....
....
In this method, I am creating a file, or I am writing some data to the file
After I finished writing, I want to pop-up a file dialog, save this file to the directory he want(like a simple file browser)
I used filedialog, jfilechooser but all showed the filebrowser dialog behind the internet browser
I want the user can see the file dialog front the internet browser
....

Meanwhile, I used to try response.getOutputStream() and writed data to the file
And a pop-up created "Save As", it worked perfectly up to now.
But After file is created, mapping does not work(return mapping.findforward(..))
Since response is submitted.
....
}

In this situation, I guess I am clear about what I want to do and I did up to now.
So, how can I handle this situation?

Thanks
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, you certainly can't use a Swing component in a web application, and I'd recommend maybe learning a bit more about how web apps work, the request cycle, etc. You want to use a download servlet (countless examples available) or action.

As to why your forward isn't working, I have no idea, you don't really tell us much other than "it doesn't work". Please see ItDoesntWorkIsUseless and TellTheDetails.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic