James Raitsev
James Raitsev

Reputation: 96461

Creating HTML pages from POJO data

If the task is to produce HTML document from some POJO bean, what is the simplest approach one can follow to get is done? Document is no more complicated then series of tables with headers and some merged elements here and there.

Solution we have today works, but is (concern) very tightly coupled with the code engine that produces the bean and I'd like to either rewrite it or use an existing solution.

(concern) The main goal is too not worry about tags, html values, table structure etc and to keep these things as much out of .java as possible.

If at all possible, do provide examples. Thank you.

Upvotes: 2

Views: 1689

Answers (2)

Tony the Pony
Tony the Pony

Reputation: 41417

Sounds like a job for a templating engine. Look into Velocity or Freemarker.

EDIT

I know you said "main goal is too not worry about tags, html values, [etc.]," but I think a template-based approach is cleaner and easier to maintain than a code-based solution.

Upvotes: 5

hburde
hburde

Reputation: 1441

Another option is apache tiles (template engine).

Upvotes: 1

Related Questions