This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JSF and the fly likes JSF - printing .txt file content Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSF
Reply Bookmark "JSF - printing .txt file content" Watch "JSF - printing .txt file content" New topic
Author

JSF - printing .txt file content

Jason A Wong
Greenhorn

Joined: Dec 10, 2012
Posts: 4
I'm having problems trying to get a text file to print on a JSF web page.
I'm trying to use hutputText to call the readData method. Am I doing it wrong?
There doesn't appear to be any errors in the code, and the web application launches sucessfully, but with a blank page.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35443
    
    9
There doesn't appear to be any errors in the code

How would you know that given this:

?


Android appsImageJ pluginsJava web charts
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14572
    
    7

Ulf was being kind. I get rather abusive towards people who swallow exceptions.

However, you should not use JSF to output ordinary text files. Or spreadsheets. Or PDFs.

JSF does one thing and does it well: processes HTML forms and formats HTML displays. Anything that isn't HTML doesn't need to go through JSF. And shouldn't. JSF is going to be trying to make HTML out of the output, and the results are not pretty.

Use a regular servlet or a JSP to output the text file.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JSF - printing .txt file content
 
Similar Threads
File encoding configuration in Tomcat
Pause / Sleep in Java
JTextarea and JScrollPane
No output to file
UnsupportedEncodingException: SJIS