[stringtemplate-interest] StringTemplate and ability to compose a view

Jevgenij [GMail] jevgenij.tsoi at gmail.com
Thu Jan 13 09:25:38 PST 2011


Greetings,
We have been looking at different templating engines and ST is one of
the most pure and very interesting.
Going from an jsp-spaghetti-hell, ST feels like a breath of fresh air.

We have an interesting use case, which I am unable to find a way to
implement in ST:
A html use case, the view looks something like this:
<body>
<jsp:include page="servlet?action=showMenu" flush="true" />
<!-- Render main content -->
</body>

The interesting bit is jsp:include call, which goes back to the
controller, the controller then produces output for the menu.
The output is dynamic, with request specific logic, (locale,
authentication, etc....)

I was trying to find in ST something like a "macro" call, that would
delegate control back to the controller,
but was unable to find it. Something in the lines of $#MenuBox()$
invokes: class MenuBox implements STMacro.

Maybe we are approaching this from the wrong angle.

How would you implement something equivalent in ST?

Regards,
JT


More information about the stringtemplate-interest mailing list