Philip Weaver <[EMAIL PROTECTED]> writes:

> What the the most source code focused rendering/templating kit? I've
> spent the past several days rolling my own simple MVC rendering api
> which creates Renderer objects which render a model and view. It's
> really simple and clean to use this to keep servlet code as
> normal/natural as possible.
>
> Most of the template engines that I see embed logic in the templates -
> I don't want that - I want all logic to be in the servlet - I simply
> want markers or identifiers (for parsing) in the template. The
> renderers is my servlet handle repeating, nesting, including,
> conditionals within the natural flow of my code.
>
> Does anything like this exist? I'm just researching to know whether I
> should release my little kit.

It's trivial to make an XML based tool do this which is why I
abandoned all these MVC frameworks and proprietary scripting solutions
(like JSP) a long time ago.

In brief, what you do with XML is build a DOM of each view. Then you
pass the DOMs to XSLT scripts and specify parameters for your template
variables. The XSLT interpolates the variables as you specify.

The marvellous thing about this solution is that it scales up so well,
for much more complex views you can make simple XML documents with the
view data in them and pass them to an XSLT. In effect, the XML
document becomes the model.


Nic

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to