velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Stevens <>
Subject You make the decision. (Mini-Essay #1)
Date Fri, 09 Feb 2001 18:33:49 GMT
Hey all, this is just the start of more coverage on why JSP sucks. I will
eventually compile these mini-essay's into an essay titled "You make the
decision." and publish it on the web somewhere (in other words, I'm
collecting information).

    "" <- quotes from the article
    [] <- editorial comments from the pain in the ass


"Now, we're big fans of Java - we've used it in the past, and will do so
again in the future - but this series of tutorials isn't about Java. It's
actually about an offshoot of Java..."

[Suddenly JSP is an "offshoot" of Java. Right there you have the problem
that people are now encouraged to write some pseudo Java in their JSP

"And so, JSP was developed to separate application logic from the interface,
so that changes to one would not affect the other. Working closely with
developers like The Apache Group, JSP uses a tag-based approach (similar to
PHP and ASP) which allows designers to make changes to the user interface
without affecting application logic."

[ I see...they DO slightly get it...except that they compare the
"tag-based approach" to PHP and ASP which don't use a JSP style taglib
approach...hmmm...keep reading...their misstatement will become real clear


[blah blah blah about scalability...]


// asking for it!
out.println("Waiter, can I have a cup of Java, please?");

[The *FIRST* example of JSP usage is embedding Java code in the page. There
we go! The earlier misstatement is now clear! They mean that because your
CODE is embedded in <% %> tags that that is taglib just like ASP and PHP!
This is *exactly* what JSP taglibs are trying so hard to avoid and no one is
getting it! LOL!

Now, take that example and try making the word "cup" in a font size of +2.
In order to do that, you need to embed HTML within your String. What will
that look like?

// asking for it!
out.println("Waiter, can I have a <font size=\"+2\">cup</font> of Java,

How many strictly HTML designers do you know that can properly escape a
String? On top of it, you are now no better off than creating a Servlet. The
point being is that JSP simply moves the problem around. Before you needed
to have an IDE and a compiler, now you just need a text editor.

Oh wait, the above example is the wrong way to do it. There are better
ways...the point being that articles such as this one don't bother showing
it. They show the WRONG WAY FIRST! DUUUUUUUHHHHHHHH! This is another example
of why JSP Sucks.

Every JSP statement ends in a semi-colon - this convention is identical to
that used in Perl, and omitting the semi-colon is one of the most common
mistakes newbies make. Just as an example, here's what happens when you omit
the semi-colon from the example above:

org.apache.jasper.JasperException: Unable to compile class: Invalid type
                out.println("Waiter, can I have a cup of Java, please?")
: Invalid declaration.
2 errors"

[Ok, here is the next reason why JSP sucks. They forgot a single ;. How many
designers do you know that can properly read a stack trace that doesn't even
give a good error message as to what the problem is? This is yet another
reason why JSP has sucky error messages because it depends on the
javac compiler to get its information.]


[This page simply continues the tradition of embedding more Java code into
your page. How many designers really know what a String object is? It goes
on to explain the difference between <%! and <%...gee...I wonder how many
designers understand scope?]


[ only gets we are doing math within our JSP page and
we are embedding even more HTML into out.println() statements. I love it!
More examples of exactly why JSP sucks! The people who write the articles on
JSP can't even provide a good example of how to "properly" use JSP!]


[Again...yet *another* page of the exact way that you shouldn't use JSP.]


[This is great! An entire page showing how JSP is no better than SSI!]

"And that's about it for this week. We've shown you the basic building
blocks of JSP, and next time, we'll be using those fundamental concepts to
demonstrate JSP's control structures. Don't miss it!"

[It also is the end of Part 1 of the article...where in the next article,
they promise us to show us more thrilling examples of how to embed more
logic in our pages and completely destroy any semblance of the "Model 2" MVC
model that JSP is trying so hard to achieve.]



Yes, it is possible to do JSP correctly in such a way to follow MVC/Model
2/Pull Model methodologies. We all know that. That isn't the point though.
The point is that very few people actually use JSP correctly. In fact, it
can be stated that JSP almost *encourages* people to do it incorrectly
because it makes it so easy to do so. Articles like this on DevShed one are
a prime example of that.

Instead, why not use technologies that encourage you to do things correctly
and actually make it easier for your HTML designers to work with?

These technologies are also available from the Apache Software Foundation,
under the same open BSD style license. In fact, not only are the
technologies 100% open, but so is the specification (unlike JSP which
requires you to sign an NDA and join the JCP).

You have a chance to more closely define what goes into your technology
instead of waiting for Sun and other corporate vendors to dictate what they
think you should do and how you should do it.

You make the decision.



If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<> && <>

View raw message