This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Software Teaming: A Mob Programming, Whole-Team Approach and have Woody Zuill and Kevin Meadows on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

How to create a HTML file using core java??

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I am in need of your help. I have a piece of code which reads data from a database and writes it to a flat file. Instead of writing it to a flat file we have to present it in a structured way using HTML.Here I don't know that I have to create (embed) the whole HTML tags in the program itself or how to generate a HTML file using core Java. .This is just to display the output(something like reports in HTML).Please help me folks.This is very urgent.
TIA,
Regards,
Murali
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Well what do u mean by core java.. If u need to throw the report back to the browser u could use a servlet and embedd html tags on it.
If u do need to write a file on to u'r hard disk use i/o for the same. let me know if u do need a program to srite a html file.
regards
riaz
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could take an approach of JSP Engine. Create a template.html file, with some markers in it for Dynamic data, like <INSERT NAME HERE>. Then use input streams to read from template.html and write it to some other html file. While doing this when you encounter the <INSERT NAME HERE> , write name instead of the custom tag. Ofcourse this gets complicated when you have more dynamic data and need to organize them in some structure, but it will be surely easier and configurable.
 
reply
    Bookmark Topic Watch Topic
  • New Topic