aspose file tools*
The moose likes JSF and the fly likes [HELP] Write Object to File from JSF page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "[HELP] Write Object to File from JSF page" Watch "[HELP] Write Object to File from JSF page" New topic
Author

[HELP] Write Object to File from JSF page

alfonz jan frithz
Greenhorn

Joined: Apr 20, 2009
Posts: 20
Guys, I am newbie in JSF and now I really get stuck on this topic. I want to make such a simple data table that get value from List, but to make it stored, i want to write it to a file. This is what i have:



The page works, but it didn't write any file. Is it correct to put action listener there? or just put action only? Can anyone give me suggestion, or any references so that I can read and write file from JSF page? Thanks

Regards,


Alfonz Jan Frithz
alfonz jan frithz
Greenhorn

Joined: Apr 20, 2009
Posts: 20
still waiting for help...
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

You specified a relative filename in your File constructor. Probably a file got written, but not where you thought it was being written. You're better off giving an absolute filename path.

Also, don't try to write the file into your WAR or any of its subdirectories. Even when it works, it's very bad practice. Use a directory outside of the webapp.


Customer surveys are for companies who didn't pay proper attention to begin with.
alfonz jan frithz
Greenhorn

Joined: Apr 20, 2009
Posts: 20
Tim Holloway wrote:You specified a relative filename in your File constructor. Probably a file got written, but not where you thought it was being written. You're better off giving an absolute filename path.

Also, don't try to write the file into your WAR or any of its subdirectories. Even when it works, it's very bad practice. Use a directory outside of the webapp.


Thanks Tim, finally, I get it work. You were right, when i put the absolute path, it works. Again, thanks...
Btw, I like your quote... hahahahhahah
 
jQuery in Action, 2nd edition
 
subject: [HELP] Write Object to File from JSF page