Esquire Theme by Matthew Buchanan
Social icons by Tim van Damme

01

Jun

JSP EL 2.1 versus EL 2.2

I just ran into lovely feature of JSP EL 2.2 that you can call methods on an object that are not getter/setters props.

The irony is that I didn’t even think it was a feature because almost every other template language allows you to call methods (Velocity, Jelly, Scalate, and probably FreeMarker).

I found this out because I develop on Tomcat 7 but we use Tomcat 6 in production. This alarming feature being added with out much press would have normally surprised me but I have gotten used to it with the neglect and suckage that is JSP.

It seems like a majority templating languages do not change much after there first initial release. For example Velocity and Freemarker have been pretty much the same since they were released. But not JSP. It has been redefined, eaten, barbecued, and then sausaged with a dozen other half ass implementations. I’m all about iteration but for craps sake can they get it right.


Luckily BalusC on Stackoverflow (he is like the Jon Skeet of Java) posted the differences between the different versions.

As a side note I seriously wonder if anybody at Sun (Oracle now) has actually made a website before. The crap they give you with the standard EL functions (another tacked on idea) is minimal. So minimal that they made an fn:escapeXml but forgot fn:escapeHtml. One who has built websites would know there is a difference in an escaping xml and html.

But now with JSP EL 2.2 aka Unified EL 2.2 aka who-the-fuck-knows you can essentially use Velocity’s Tools not that that is much better.

Well if you would like to use methods in JSP 2.1 see my Stackoverflow Post.