tags:

views:

323

answers:

1

I'm trying to use expression language inside jstl tags but strange error occurs.

"According to TLD or attribute directive in tag file, attribute value doesn't accept any expressions"

The code is something like this:

<c:out value="${header['host']}"/>

But next code executes well:

${header["host"]}
<c:out value="hello"/>

I added jstl.jar and standard.jar to WEB-INF/lib/ (and to classpath). Directive for including jstl is standard:

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

JSTL version is 1.1.2

App-server: tomcat 6.0.16

+2  A: 

You must use this URL in your taglib declaration.

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

Be sure your web.xml has declared servlet spec 2.4+

This article has the explanation: How to Reference and Use JSTL in your Web Application

victor hugo