Hans Bergsten wrote:
> JSP can also be combined with servlets, as well as JavaBeans and
> Enterprise JavaBeans, so I see the same possibilities with JSP as
> you describe for templates.
I tend to think of "JSP vs templates" like "C++ vs Java". Sure, you
can do everything in C++ that you can do in Java. So why is Java
winning market share? Partially it's because Java makes it easier to
write and read code, plus it helps enforce good design.
> For instance, you can (should) separate the request processing.
> One common way of doing this is to let
> a servlet receive the request, use and create beans to process the
> request, and then select an appropriate JSP page for presentation
> of the result.
And you (should) write OO C++. Meanwhile, Java makes you. I prefer
that, just as I prefer how template engines enforce the separation.
> > 2. Template systems do not require non-standard extensions to
> > Java, which is what JSP is. They work in any webserver with
> > an ordinary JSDK and Java runtime. The same cannot be said
> > of JSP (which emphasizes standards because it is non-standard).
>
> I'm not sure I understand this argument. Both the Servlet API and
> JSP are standard extensions (packaged in javax packages). JSP
> works in any web server that supports the Servlet API.
JSP doesn't work fully in Servlet API 2.0, which is what Apache/JServ
supports. And the specific portion that's missing is the
RequestDispatcher part that allows you to do the separation discussed
right above. Plus, JSP 1.1 support is very spotty and each vendor has
their own bugs you have to work around. There's something nice about
WebMacro working with the older Servlet API 2.0 and without any
vendor-specific bugs. There's just the one open source implementation
to fix bugs in. Kinda like Perl.
> Like you say, it's possible to do a bad implementation with any
> technology, not just JSP.
C++ vs Java again. I like the one that makes it harder to do a bad
implementation.
> Have you looked at what you can do with custom actions (tag
> libraries) in JSP 1.1? I have implemented a number of custom
> actions that can iterate over a number of data types, such as
> arrays, Vector, Enumeration, Hashtable.
C++ vs Java: C++ has a String type in the STL, but it'll always be an
add-on even though it's a standard. I prefer Java's core knowledge of
Strings. I also prefer WebMacro's core knowledge of iteration types
(with the ability to write my own if I want to get fancy).
> They can easily be extended to support all the new Collection API
> types as well. With a set of custom actions I'm pretty sure you can
> do anything that you do in WebMacro.
But not as well.
> one of the most important
> advantages with JSP over any of the template systems is that it's
> formally specified and included in J2EE. This means it will be
> covered in classes, books, endless web sites, etc. And therefore be
> familiar to a lot of people.
Perl isn't formally specified apart from implementation (at least I've
never seen the spec), but yet it's still *widely* covered. An open
source implementation that works everywhere is equally good as a spec
in promoting classes, books, web sites, etc.
> This makes it a lot easier for an employer to find people that do
> not need to get additional training, makes it easier for developers
> to share experience, creates a market for both Open Source and
> commercial custom action libraries, allows web design tool vendors
> to provide great integration, etc. In short,
> all the advantages of a broadly supported standard.
These are arguments against using a single-vendor solution, but against
a popular open source technology they don't really work. WebMacro can
succeed as well as Perl or Apache in all these areas.
-jh-
P.S. Great topic for today considering I just posted an article
comparing JSP to WebMacro. If you didn't catch my earlier email,
it's at http://www.servlets.com/soapbox/problems-jsp.html.
--
Jason Hunter
[EMAIL PROTECTED]
Book: http://www.servlets.com/book
2.0 to 2.1: http://www.javaworld.com/jw-12-1998/jw-12-servletapi.html
2.1 to 2.2: http://www.javaworld.com/jw-10-1999/jw-10-servletapi.html
___________________________________________________________________________
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