• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to send console output to a html page

 
Suresh Kumar Baddipudi
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i wrote a java program, in that i used "System.out.println()" to print the output in the console. Now i want to print this output as a html page. Please help me regarding this issue. Thanks in advance.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does this have to do with WebSphere (which this forum is all about)?

When you say HTML, do you mean you want to create a physical HTML file, or that this code should run in a servlet container and write an HTTP response?
 
Suresh Kumar Baddipudi
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need to create a physical HTML file only..
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then you'd need to use the classes in the java.io package, particularly File, FileOutputStream, OutputStreamWriter and BufferedWriter. Be sure to pay attention to which encoding you're using, and to embed a META tag in the HTML file that specifies the encoding; it's probably best to use UTF-8.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic