Took me a day and a couple experiments to figure out what went wrong. Maven web application archetype creates project for J2EE 1.3 and has a web.xml with web-app_2_3.dtd, which seems to be the cause why JSTL is not working.

<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
  <display-name>Archetype Created Web Application</display-name>
</web-app>
 

The solution? Simply copy over a web.xml in web-app_2_5.dtd seems to fix the problem.

<⁞?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
  http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
    </web-app>

I am surprised that I cannot find a solution by searching the net, either I am very bad at search or the problem is too obvious to fix. Anyhow, hope this post would help people like me.

Comments:

Thanks- I was working this for a couple hours, unable to figure out why the expression language wasn't being picked up.

Posted by coffeejolts on May 22, 2009 at 08:15 AM PDT #

What was the issue you had with JSTL? We are having a similar problem.

Posted by Devan on July 15, 2009 at 01:34 PM PDT #

Devan,

The JSTL tag simply doesn't get evaluated and it is because the web-app tag doesn't specify web-app_2_5.xsd.

Posted by Henry Jen on July 15, 2009 at 02:16 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by slowhog