Let's see...

Robb Shecter wrote:
> What's a typical template evaluation system?  How does the code look that servlet
> programmers must write when they use it?

1) What's a typical template evaluation system?

This question is a little vague, so I'll answer it twice:

1a) What is an HTML template evaluation engine?

An HTML template evaluation engine is a collection of Java code that
reads an HTML template and evaluates based on tags in the template that
refer to Java objects and methods. One example of this is JSP, although
JSP has the additional benefit of being pre-compiled (and thus
pre-parsed) and the potential problem of allowing Java code to be
written in the HTML, which can destroy the distinction between
presentation and business logic.

The main reason to use a template engine is to separate the HTML (the
"look" of a page) from the business logic that generates that hard
information in the page (name, address, account balance, etc.). In a
nontrivial system, this allows that process of developing the "look and
feel" of a dynamic web page to be separated from the process of
developing (or simply re-using) the business logic. Thus they can be
developed concurrently, one by HTML/design experts and the other
Java/enterprise experts. Further, a template engine allows the "look" of
a dynamic web page to be updated in a production system *without
changing any code*. This is important, IMHO, as clients like to tweak
HTML.

1b) What HTML template evaluation engine are available for
Java/servlets?

Here's a list of template engines that I'm aware of. I have played with
most of these, so I don't offer any recommendations. They are in no
order.


http://java.sun.com/products/servlet/presentations/jbe-tutorial-part2/index.htm
  http://www.locomotive.org/
  http://www.factum-gmbh.de/gb_products/object_html.html
  http://www.webmacro.org/
  http://java.apache.org/cocoon/index.html
  http://bgeer.com/dexios/
  http://www.meangene.com/otembo/
  http://www.enhydra.org/
  http://www.tapsellferrier.co.uk/engine.html
  http://ceriumworks.com/
  http://www.dnt.ro/~costin/

Again, I have nothing to do with any of these and I have not used most
of them. These are just links from my bookmarks. If I have missed
someone's favorite, please let me know.

2) How does the code look that servlet programmers must write when they
use it [a template engine]?

Depends on the engine itself and the overall architecture of the
servlet/page generation system. For example, JSP allows you (forces
you?) to embed Java code in an HTML page. This page is then compiled
into a servlet. Other systems allow you to call Java methods in the
template, and the template is accessed for every request. Still others
allow you to refer to database rows and columns directly from the HTML.

Except for JSP (which is a "standard" which is supported by several
different servlet servers), each template engine has it's own way of
co-ordinating the template and the Java objects or methods/classes that
the template refers to.

- Paul Philion

PS: Permission is granted to include this information in a FAQ, and long
as credit is given.

___________________________________________________________________________
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