Ondra Žižka
Ondra Žižka

Reputation: 46796

Wicket: How to generate pages through API (rather than through HTTP)?

We have a commandline application, which generates HTML files. So far we use Freemarker. I'd like to use Wicket in a similar fashion: Give it a map of arguments, perhaps models (which are Java obects), and let Wicket render the HTML file.

What would be the way to do this? Is it supported? I mean, is there a public API for that, rather than using some internal API that is a subject to change in minor releases?

Upvotes: 0

Views: 115

Answers (1)

martin-g
martin-g

Reputation: 17513

See org.apache.wicket.core.util.string.ComponentRenderer#renderPage(PageProvider).

Another way is to use WicketTester#startPage() + WicketTester#getLastRenderedPageAsString().

Upvotes: 3

Related Questions