Modifying Struts 2 themes can be a frustrating task for people
unfamiliar with FreeMarker templates, especially fiddling around with
those pesky little <#lt>,<#t> and <#rt> tags and built-in variables.
Mainly to reduce my own frustration, I've created a little tool to help
preview the FreeMarker output while typing it:
http://www.freemarkertool.com/
Just start typing immediately or view and edit the examples. I've
preloaded it with struts2 div and struts2 checkbox tag examples that you
can edit directly.
For those interested in the software architecture:
- It's a Struts 2 webapp (naturally)
- All action results (including errors and exceptions) are in JSON
thanks to the JSON Plugin
(http://cwiki.apache.org/S2PLUGINS/json-plugin.html)
- The client-side interface is built on YUI
(http://developer.yahoo.com/yui/) and the client manages all state
At the moment the Template Context is limited as the root object is a
Map rather than a Struts2 UIBean or page context. This basically means
you can't use includes, reference other struts2 tags, custom beans or
custom methods (among other Freemarker features). You can create quite
complex structures or hashes, sequences and string /boolean scalars
though (eg. a tags fieldFrrors and dynamicAttributes can be defined).
If there's any interest from Struts 2 users I may add the Struts 2
environment itself as a root context option.
Anyway, I hope it's useful to someone else and apologise in advance for
the teething problems. Let me know your thoughts, bug reports & feature
requests (if you're on struts-users you've got my direct email address).
regards,
Jeromy Evans
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]