Tuesday, March 11, 2008

JSTL Error : According to TLD or attribute directive in tag file, attribute value does not accept any expressions

Tried using JSTL with the JSF in my app. (My pages are HTML not XML) Tried accessing Session variables

<c:out value="${sessionScope.user.name}"></c:out>

BUT it threw me the above error. Did some searching and came up with this amendment to the taglib tag.
Instead of the standard,
<%@ taglib uri='http://java.sun.com/jstl/core'
prefix='c'%>
use the taglib,
<%@ taglib uri='http://java.sun.com/jsp/jstl/core'
prefix='c'%>
(notice the 'jsp' web folder in the URL)
This solves the problem, probably cos my pages are HTML in contrast to XML.
Go to the linked page for more details

1 comment:

Anonymous said...

Thanks for a solution. Works fine.