2008/8/27 Nino Saturnino Martinez Vazquez Wael <[EMAIL PROTECTED]>:

> I did something similar once, but realized somewhere in the process that it
> werent exactly the same content writing a mail as the web page. I used the
> wicket text templates heavy instead.
Ok, I've made it. I've created "class TemplaterApplication extends
Application" (and all related classes Request, RequestCycle, etc) and
WicketTemplater over it. It takes TemplatePage (child of wicket.Page)
implementation and writes result to given java.io.Writer. All stuff
like sessions, versioning, request parameters are disabled,
TemplatePage is always stateless.
Yes, web page is not the same as email, but very-very close. Of
course, it's nearly impossible to reuse the same WebPage, but you can
reuse some your components both on WebPage and TemplatePage. And of
course it's possible to use most standard wicket components like
wicket:border, wicket:extend, repeaters, etc...
Yet another great benefits, but I've not done it yet:
- it's possible to make auto-linking of resources. Say, if you have
<img> on your page, the generated email will have the image attached
and properly linked as "cid:" resource.
- if you have a link in email to your web-site back, it could be
properly handled and checked if it actually links to correct Page.

If somebody find it interesting, I can to share my code and actually
it's possible to make "html templater" and "html email generator" as
yet another library.

-- 
WBR, kan.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to