Hi Jason,
Well, I dont much agree with your article, at least in the way of a
template engine being a better alternative to JSP. I can see how in some
cases it may make sense for those either too lazy or too unwiling to
understand the JSP syntax. To me, a template engines syntax means learning
a lot more than JSP syntax. Sure, you can mistype the <%! with <%, but if
you learn JSP, you'll know when to use one or the other.
A particular note:
: Lousy Looping
Looping is overly difficult in JSP. Here's the JSP code to iterate over a
vector of ISP objects printing the name of each.
<%
Enumeration e = list.elements();
while (e.hasMoreElements()) {
out.print("The next name is ");
out.println(((ISP)e.nextElement()).getName());
out.print("<br>");
}
%>
Uh..what about this:
<%
Enumeration e = list.elements();
while( e.hasMoreElements())
{
%>
The next name is <%= ((ISP)e.nextElement()).getName() %><br>
<%
}
%>
Seems easy enough to me, and its easier to learn and use than say, a
template engine. Think of it this way, a Java engineer would most likely
feel more comfortable learning and using JSP, since its the Java language,
than having to learn all the idiosyncracies of a template engine.
Also, what about J2EE? Is a template engine going to be part of the J2EE
specification? I dont think so..at least not anytime soon, if it even
catches on. I think with the advent of J2EE, JSP, Servlets, EJB, WAP, WAR,
etc..template engines will not be fitting into that picture, and alot of
application servers will be supporting J2EE.
How exactly is a template engine used anyways? Is it a plugin to app
servers, web servers, etc? I assume it would be a servlet perhaps that
parses the data sent to it returning back a response? If thats the case,
then I can see it added to a servlet engine where an extension of say .wm
(webmacro) is mapped to the servlet engine, and thus passed on to the right
servlet to parse it.
Anyways..for whats its worth, I have read your book and consider you a java
guru indeed. But I dont agree with you on this. In all honesty, I cant
imagine why you, who wrote a book on servlets, wouldnt use the JSP (or
promote it) over something as (to me) arcane as a template engine. Seems
that JSP would fit right along well with servlets, since its an extension
to it. I was looking forward to a new book with more info on JSP from you.
I guess thats not going to happen..is it? :)
Kevin Duffey
Software Engineer
[EMAIL PROTECTED]
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html