GeeCON Prague 2014*
The moose likes Java in General and the fly likes Generating HTML pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Generating HTML pages" Watch "Generating HTML pages" New topic
Author

Generating HTML pages

Luke Shannon
Ranch Hand

Joined: Sep 30, 2004
Posts: 239
Hello;

I am building an application that generates static HTML pages based on the data in a database.

Does anyone know of any packages that exist for such a task, some sort of HTML template class or something like that? Anyone done this before and can offer some tips?

Thanks,

Luke
[ December 12, 2004: Message edited by: Luke Shannon ]

Luke
SCJP
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Google for "java document management" and you'll find some pretty good open source projects. I found them a little huge and involved for what I needed and haven't actually tried any yet.

You might look at Java Wiki code like FrikiWiki (the author is here at the ranch) and Fitnesse. These do "real time" conversion of templates to HTML on a dynamic web server, but you could surely borrow some of the rendering ideas to use in batch to generate static HTML.

I generate static HTML for my hobby site in a scripting language (REXX) that lets me execute a block of code in a string so it was dead simple to embed script into my templates. It's described HERE but it looks like the link to dowload it is missing. Lemme know if it's at all interesting.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Luke Shannon
Ranch Hand

Joined: Sep 30, 2004
Posts: 239
Thanks Stan.

I am going to look through some of these open source options.

Luke
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
Also velocity and
FreeMarker. Both very suitable for generating HTML, with stuff from database.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Luke Shannon
Ranch Hand

Joined: Sep 30, 2004
Posts: 239
Freemarker looks very close to what I was searching for.

Thanks.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Generating HTML pages