On Tue, 25 May 1999, Craig R. McClanahan wrote:
....
> Of course, the tempation to embed application logic in scriptlets will always
> be there with JSP, but that does not necessarily mean that smart developers
> will succumb to the temptation.  :-)
....

JSP may be considered as another template system, using a higher
level language - Java.

A good template engine/servlet system can result to much simpler
template source.. Because the engine itself can embed powerfull
features not predicted by JSP designer, that would require
hard-to-read java code mixing with .html
>
> On the other hand, even if they do, a standardized scripting environment is
> still IMHO better than a non-standardized template world that locks you in to a
> particular vendor (even if the source code of the template engine is free, the
> cost of switching later is very high).
>

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...

   - More powerfull features lacking now in most template systems
    (including JSP) like:
     - Mapping betwen input form fields and setXXX() calls
     - exception handling within templates.
     - automatic internationalisation (like choosing a template source
       depending on user's language prefferences)
     - output diverting...
     - Output stream buffering - allowing:
         - adding response headers during/after template processing
          (e.g. Content-Length)
         - a more sophisticated exception handling, like dispatching
           the response to a different resource, when something
           goes wrong, even output has been written
     - easy-to-use formatting for dates, numbers, other objects...


-------------

Example (for formatting)

Use in some include "CommonDefs.tmpl" :
<DefineFormat  NAME=HourAndMinutes
               Formatter=some.FormattinClass
               Option="hour %H and %m minutes"
               FormattedClass="java.lang.Long"
>


And in the main template, that includes "CommonDefs.tmpl",
the web designer will see something easier to understand:
<BR>
Session started at
<ShowData
   Object=Session.StartTime
   Format=HourAndMinutes
>
<BR>..

And thus doing not only sepparation betwen logic/presentation
but also a cleaner reusability, with intermediate "hidden" levels
(like previous included file) between logic and presentation.

(The some.FormattinClass being able to
represent a long as a Date, for various formatting strings.
Not only it wont be necessary to call its formatting method(s) any
time we use it, like JSP would require, but it can be used in many
templates, just by including a shared template and mentioning what format
definition to be used to print a Long as a date at template's output.)

-------------------------------------------------------------


Cezar.

___________________________________________________________________________
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