Scriptlets are the (today) Java code that appears between <% %> tags in a
JSP page.
IMO, in general these are a bad idea (notice the in general), but will have
a place. I have many problems with scriplets, most of which have been echoed
on this list, mixing presentation and business logic has always been a bad
idea, but there are other issues as well, not least debugging the things!
One of the things I've never liked about ASP is the heavy mix of script and
HTML - because of that it is very difficult to work out what the page is
meant to look like, and conversely what the script is meant to achieve. By
seperating these two aspects they can be developed, viewed and maintained
seperately.
The other thing is this - I bet that most (if not all?) the people who
contribute to this list are Java developers first, or at least have a good
grasp of Java. What that means is that we all understand the OO aspects of
the language and could design and build Java applications, we understand
that JSPs are compiled to servlets and wouldn't be afraid to look at the
generated servlet to see what was going on (in fact I seem to spend my life
doing that to debug the JSP pages ;-) ). How true is that of people whose
main occupation is to design and write HTML pages using either JSP or ASP or
just straight HTML?
I teach Java programming, and used to do a Java language course where we had
students whose experience ranged from 10 years C++ (i.e. they didn't need to
be taught) through those who had some OO and/or C++ (ideal audience) down to
webmasters! The webmasters knew HTML and a script language - these people
really struggled to learn Java. That (again IMO) is why it is vital to keep
the UI/Business Logic seperation, to protect the page designers from us.
If you're a one or two man development team fine, go ahead and use
scriptlets, but if your doing a large scale development or have somebody
else design web-pages out of house (which many companies do) then mixing
Java into an HTML page is a really bad idea. From a page designers point of
view it is much easier to learn a few new HTML like tags (USEBEAN etc.
although thay aren't perfect) than to have to learn to write Java, and learn
how to manage and debug projects
Just my 2c,
Kevin
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Brad Neuberg
Sent: 22 April 1999 03:39
To: [EMAIL PROTECTED]
Subject: Re: Why Model 2?
What is a scriptlet?
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".