savefiledialog - Save ArrayList into CSV-File Apache Wicket -


how can "write" arraylist in file, can download after writing? 1 element in list 1 line in csv-file.

for example: have arraylist<string> mylist = service.getlist want write in file. in simple client-only-application easy. have apache wicket. nice, have filebrowser, can specify, in directory want download it.

i thought, work way:

final file filetosave = new file("exported objects.csv");         writer writer = null;         try {              writer = new bufferedwriter(new filewriter(filetosave));             writer.write("");             (obj o : listo) {                 writer.append(o.getasd);              }         } catch (ioexception ex) {             // report         } {             try {                 writer.close();             } catch (exception ex) {             }         } 

but won't. have use jboss-server. on local jetty-served worked, on jboss-server it's not possible way. wicket-version: 1.4.7

see wicket's downloadlink download functionality, , use temporary file (file.createtempfile()) create downloadable csv. way creating file in current working directory of container. might not have write privileges in location, temp should work.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -