apache apachecon apacheroller app apple asf atom atomprotocol atompub barcamprdu blogapps blogging businessblogging conferences family feeds foss general glassfish google humor ibm java javaone links linux mac microsoft movies music netbeans opensocial opensource photos politics rest roller rome rss socialnetworking socialsite socialsoftware sun triangle trianglebloggers vacation webdev webservices wiki


Sunday Mar 21, 2004

Another JSTL quick ref

via java.blogs

Defending ugly old JSP.

Russell Beattie complains about the ugliness of JSP, even with the improvements of JSP 2.0. I have to agree. JSP is ugly. JSP also does very poorly in the separate-logic-from-presentation department, scoring an entanglement index of five - and JSTL does not help at all. JSP is butt ugly, but in JSP's defense:

  • It is possible for JSP source code to be valid XHTML. Russell could have done this in his mock-up example by setting a variable and then using the ${var} syntax instead of using "an embedded x:out tag within the href attribute". In theory, by validating your JSP source code as XML and by pre-compiling the JSP at build-time you can weed out a lot of potential errors.

  • Other popular web template languages are just as bad. Velocity, FreeMarker, and Tapestry's template language all have entanglement indexes of five as well.

  • The option of embedding Java code in JSP makes JSP very powerful. Like C++, JSP gives you enough fire-power to blow your entire leg off with one pull of the trigger.

  • Compiling down to Java byte code makes JSP very fast.

  • JSP is an accepted Java standard, it's built-in, it's well understood, and it's easy to find experienced JSP developers.

That last point seems important to me. Perhaps it is not justified and I'm just a Sun lemming, but I'm a little wary of Java web frameworks that attempt to completely side-step JSP.

This work is licensed under a Creative Commons License.
Copyright 2002-2007, David M Johnson (dave.johnson at rollerweblogger.org)

This is a personal weblog, I do not speak for my employer.