Nicolas Pujol wrote:
> I keep seeing people on this mailing list using all kind of convoluted
> coding with their JSP pages, particularly in the context of holding session.
> I would like to make a point. As far as I am concerned the beauty of JSP
> rests almost exclusively in the BEAN tag or more recently the USEBEAN tag.
> Apart from the that JSP is nothing more than a regular scripting language
> like ASP or Javascript and LiveConnect.
I think this is true.
>
> I believe that as Java programmers we have to support the virtues of
> OOP/OOD. The Bean tag should be used over extensive scripting within the
> JSP. Using beans allows for easy maintenance of a page and more generally of
> a site. In addition, it allows for Web development teams to delegate more
> clearly their work into JavaBeans programmers (business logic) and Web
> Designers (web presentation). It is important to note that the two have to
> come together at some point. It is this "point of convergence" that needs to
> be analyzed and studied extensively by Web architects.
The issue as I see it is that on the one hand JSP makes "scripting" in a
page easy (at least easier than writing a servlet). On the other hand,
if you're concerned about proper partitioning of business logic (i.e.
not putting it in the page) - this approach isn't so great.
Architecturally, we would prefer to only have display references in a
page, not logic. This makes it easy to send pages to a designer and not
care what they do to it. All of the code goes into a servlet which
makes use of Beans (components) and the HTML template (JSP) simply has
display refereences.
The downside to this is that the ease of use disappears. We have to
code servlets again.
We've been working on a solution that allows the "scripting" to happen
in a configuration file. This file allows declaration of JavaBeans,
property setting and method calls, and the HTML template has to have
only references to values generated by the configuration. This seems to
be the cleanest approach that also offers ease of use. The real "code"
is still in the beans, but you don't have to write a servlet or embed
Java in your HTML page. Maybe JSP will get there....
--Dave
===========================================================================
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".