JSF with JSP 2.1 on Sun App Server 9.106/24/2008
|Tips & Tricks|
Otra vez la burra al trigo. Now, a user needs to publish a web service implemented in XFire and two Web applications that include Java Server Faces, Spring and Hibernate on an application server; As we were originally asked for Weblogic licenses, we said to ourselves "ummm… we should include a Sun Application Server quotation instead, to see if they like it". Of course, considering they needed 10 licenses, the amount saved by our customers is pretty step (more than US$100,000 in savings) and we were asked for a small proof of concept (POC) that included load testing to see if the App Server was well suited to their needs.
As I had to do some juggling bringing together people from development, application support and infrastructure, I could not perform the tests as I wanted and I opted instead for the installation of two working instances of the last versions of the Application Server (8.2 and 9.1), in such way that they will eventually perform their own tests. I hope that by speaking with the department manager it is easier to close the deal, and I no longer have to be dealing with these boys. This is because every minute they keep annoying me with comments like "hey, I can do this with Weblogic, you can’t do it with your application server, do you?" and obviously I have to show them you can – as a reference, the Sun Application Server 9.1 is the equivalent in almost all functionality aspects to the Weblogic 9 – but the explanations consume a lot of my time and we can’t move forward with the installation and testing.
When deploying the web application on the Sun Application Server 9.1 it throws the following error:
Where the code snippet that is the root of the problem is as follows:
And although at first glance there is nothing wrong with it and in some forums it is recommended to configure the web.xml to prevent expression parsing among the jsp tags, the real source of the problem has to do with the JSP specification, which is the version 2.1 for the Sun Application Server 9.1; the libraries that throw this kind of errors are written with the JSP 2.0 Specification.
The amazing news is, the new JSP Specification for JEE 5 requires spaces for the ternary operator (<expression> ? <if true> : <if false>). Therefore, if we change the previous code snippet with the following:
The application should work correctly. Note: You may need to do the same "space adding" scheme in more than one configuration file in order to prevent any error of this kind from happening again.
Although I do not know the JEE 5 Specification cin all its extent, it is unusual that it has problems with the OGNL libraries such as this, which are practically the base of any web framework like Struts or Tapestry. In the meantime, I am waiting for these "kids" to end up their load tests successfully so I can go with the Head Honcho to tell him "Did you see? Everything works just as fine; please sign this cheque here."