I agree with you completely, Dan.
In our last project our servlets were passing beans to JSP pages, and in
some of these the simplest way to get data out of them was a few lines of
Java code in the JSP.
I'm not convinced that the complete separation of HTML and Java is a
particularly worthy goal. Like you, I'm a Java developer that's quite good
with HTML and Javascript, and perhaps this slants my perspective.
Given that it's so easy to write a short scriptlet to invoke a custom Bean
of some kind, perhaps you'd start thinking about making a taglib when you
find that you're writing the same non-trivial scriptlet over and over again.
The needs of the taglib users, however, would also have to be fairly
stable - otherwise you'd have them pestering the taglib authors for
revisions from time to time. The taglib authors might end up thinking that
it would be easier for them to edit scriptlets rather than update or
creating new tags.
Imagining myself in the shoes of an HTML writer interfacing with the
development team through taglibs, I think I'd feel like I was being kept at
arm's length from "what's really going on" - I much prefer calling a method
to declarative styles of programming, but maybe that's just me too! :-)
Michael
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Kirkdorffer, Daniel
Sent: Monday, June 12, 2000 3:39 PM
To: [EMAIL PROTECTED]
Subject: Taglibs - too complicated?
Having returned from a tiring but interesting JavaOne (hey, why not just go
24 hours next year?!) I wanted to comment on JSP taglibs.
As one of those supposedly rare Java developers able to design Web pages (so
we are always being told), I like using the oft maligned Scriptlets to
handle two things in my JSP: conditional actions, and looping actions.
Due to the buzz being made with JSP 1.1 and taglibs, I attended every taglib
session and BOF to find out more about them, and it would seem that to do
these things through taglibs appears to require quite a considerable effort
(I readily admit I have never written a taglib tag - but the explanations
sure weren't easy to follow).
So the argument goes like this:
- Java developers don't know Web design and Web designers can't handle Java
coding, so Scriptlets don't achieve the perfect world separation of Java
from HTML.
- So replace all use of Scriptlets with JSP 1.1 taglibs. These will make
the Web designer's task easy.
Perhaps. Certainly doesn't look like it makes the Java developer's tasks
any easier.
There is another alternative to this approach IMO: better trained Web
designers who can understand simple IF-THEN and FOR-loop constructs.
After all, an IF-THEN in Java looks just like an IF-THEN in Javascript, and
a FOR-loop in Java is no different than a FOR-loop in Javascript, and Web
designers should definitely be familiar with Javascript. Ok, in Java you
use "equals()" to do conditional comparisons of Strings. That isn't really
hard to learn.
I know the argument I'm making will not be terribly convincing to many, but
let's not dumb down the official explanations for using taglibs and let's
admit the additional complexities taglibs present.
The one place I do see a benefit is with WYSIWYG tools. However, I've never
been much of a fan of them.
Anyway, great to see the huge interest in JSPs as made evident by the size
of the audiences at JSP related sessions.
JSP books are also proliferating fast which is nice to see.
Also, it was nice to finally meet Craig McClanahan and thank him in person
for all his help on this list.
Cheers,
Dan
--
Daniel Kirkdorffer
NACN IS: 425-580-6225
Sr. Consultant, Syllogistics LLC
Email: [EMAIL PROTECTED]
Web: http://www.syllogistics.com/
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets