Apache Wicket is a great
web framework, its clear separation between logic and markup allows
to focus on what's need to be done.
As we use Wicket at
SRMvision, we needed to send
mails with rather rich templates to our users. The first
implementation we used was relying on Wicket to generate these
templates using Html. We finally don't use it (our mailing tasks are
done by a background job, thus we don't have access to our webapp),
but I though the code used in our fast proof of concept could help
If you want to generate a template using Apache Wicket, you only
need to create a Panel and its associated markup which inherits this
simple class. Then, when you want to get the Html for your
component, call getHtml().
The only drawback of this is that you need a RequestCycle to
generate the markup (you'll find out why reading the code).