Site and URL changes

In preparation for the release of my latest book, JavaServer Faces, I’ve renamed and rearranged the content on this site a bit. The new official URL is www.hansbergsten.com. The old www.TheJSPBook.com URL will also point to this site for some time, but it will eventually be deactivated. If you link to the site, please change your link URLs.

The site now contains information about all my books, recent articles, consulting services, and references to many other useful server-side Java resources. Please let me know if you have suggestions about other information or features for this site.

Why isn’t my EL expression evaluated?

In a JSP 2.0 container, such as Tomcat 5, my EL expressions in template text and action element attributes are not evaluated, they are used as-is instead. For instance:

   ${now.time}

is rendered as:

   ${now.time}

What have I missed?

Answer:
The EL evaluation is disabled for a web application with a Servlet 2.3/JSP 1.2 deployment descriptor (web.xml file) for backwards compatibility reasons.

You need to update the web-appelement in your web.xml file to the Servlet 2.4/JSP 2.0 format to enable EL evaluation by default:

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd"
  version="2.4">
  ...
</web-app>

As an alternative, you can enable EL evaluation of a page-by-page basis with the isELIgnored attribute of the page directive, or with a JSP configuration group in the web.xml file.