Caveat: I've not written a template processor, just
used them. Any suggestions I make regarding their development
should be taken with a grain of salt until I produce some code.
On Tue, May 25, 1999 at 11:30:58AM +0300, Cezar Totth wrote:
> That's why I'm asking again all template-engine developers on this list
> if it isnt the time to share opinion and try to set some sort of
> standard to allow:
> - Template inter-operability - making switching from one template
> engine to another easier for application developer.
> Or even interoperability betwen template engines, like
> including one template using JSP in another template
> using webmacro, and BOTH sharing the same
> variable/name/object space...
I don't know what this would take. On the surface, WebMacro
and FreeMarker use similar-looking names to resolve variables, but
I know the internal representations are wildly different.
> - More powerfull features lacking now in most template systems
> (including JSP) like:
> - Mapping betwen input form fields and setXXX() calls
I don't know what this means.
> - exception handling within templates.
I'm not sure what you mean. My servlets that use templates
have followed this general pattern:
try {
1. Get input from form.
2. Process business logic.
3. Construct template
4. Write output.
}
catch (SomeException) {
log it
hand off to a "we screwed up" page
}
Any exceptions I can handle in the logic, well, I handle
those. The template doesn't enter into the equation.
> - automatic internationalisation (like choosing a template source
> depending on user's language prefferences)
This is a good idea, IMHO. It could be implemented in
WebMacro's TemplateProvider or FreeMarker's TemplateCache.
> - output diverting...
I'm not sure what you mean. All of the template packages
I've seen use java.io.Writer or some subclass as their interface.
You can manipulate that as you need.
> - Output stream buffering - allowing:
> - adding response headers during/after template processing
> (e.g. Content-Length)
Possibly there should be an alternative method for sending
the template's content to the browser. Possibly
"Template.sendResponse(HttpServletResponse resp)", that handles
setting the correct content type and length before writing the
template content out.
I like this idea.
> - a more sophisticated exception handling, like dispatching
> the response to a different resource, when something
> goes wrong, even output has been written
I think this should be the job of the servlet developer.
See above.
> - easy-to-use formatting for dates, numbers, other objects...
I _really_ like this idea, especially if it can be tied into
internationalization.
--
Robert Crawford [EMAIL PROTECTED]
http://www.iac.net/~crawford
___________________________________________________________________________
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