File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Groovy and the fly likes groovy's html builder.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Groovy
Bookmark "groovy Watch "groovy New topic

groovy's html builder....

Vimala Shirur

Joined: Jan 12, 2001
Posts: 12
How to use groovy's html builder to include css file, table stuff, image stuff etc.,

Could someone show me an example how to do this?

Appreciate your response!

Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

The two code snippets below represent:
1) a script that builds the html markup and then outputs the contents with println writer.toString()
2) the result html

The example includes css, a table, and an image.

[ July 04, 2008: Message edited by: Marc Peabody ]

A good workman is known by his tools.
Vimala Shirur

Joined: Jan 12, 2001
Posts: 12
This helps. Thanks!
Matthew Taylor

Joined: Jun 13, 2004
Posts: 110

If you are doing this sort of thing a lot, I would recommend checking out Grails, which is a web framework build using Groovy and Java. It uses GSPs (like JSPs) for this sort of work,

Grails Consultant
I agree. Here's the link:
subject: groovy's html builder....
It's not a secret anymore!