This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File i/o

 
stuart broomfield
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
stuart broomfield
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17627
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic