aspose file tools*
The moose likes JSF and the fly likes File i/o Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "File i/o" Watch "File i/o" New topic
Author

File i/o

stuart broomfield
Greenhorn

Joined: Mar 10, 2007
Posts: 2
I have a pretty simple JSF app. At one stage I want to generate a text file to store some simple values.

Can't rally figure out how to do it from JSF. I know its probably a dumb question but I have very little experience with web programming.

Any help would be greatly appreciated.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

No part of your JSF code should ever handle File I/O directly. You should use a helper/business class to do this for you and then call that class' method(s) from your backing bean (controller).

Look into writing a text file with Java and forget about JSF. Then, take the code you've written and call it from your backing bean. We have an IO And Streams forum in case you need to ask specific questions about IO.


GenRocket - Experts at Building Test Data
stuart broomfield
Greenhorn

Joined: Mar 10, 2007
Posts: 2
hi and thanks for the feedback.
I am attempting this from a backing bean alright but am not getting anywhere. dont i need to get a facescotext and use that somehow?

thanks
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Originally posted by stuart broomfield:
hi and thanks for the feedback.
I am attempting this from a backing bean alright but am not getting anywhere. dont i need to get a facescotext and use that somehow?

thanks


You might just try what I already suggested. Why do you think you need to get the faces context and "use that somehow"?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16308
    
  22

My general rule for JSF software development:


If you have to include a javax.faces class in your backing bean, you're probably trying to do something the hard way.


I try to break it as rarely as possible.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File i/o