Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSTL functions is not found in JSF

Tags:

jsf

jstl

I am trying to add an active class on the page the user is currently viewing but I can't manage to use the JSTL functions. What am I doing wrong?

xmlns:fn="http://java.sun.com/jstl/functions"

Using this in a h:link

styleClass="#{fn:containsIgnoreCase(request.requestURI,'index') ? 'active' : ''}"

causes this error:

styleClass="#{fn:containsIgnoreCase(request.requestURI,'index')}" Function 'fn:containsIgnoreCase' not found
like image 546
LuckyLuke Avatar asked Apr 15 '12 20:04

LuckyLuke


1 Answers

You've got wrong import, it should be :

xmlns:fn="http://java.sun.com/jsp/jstl/functions"

You forgot about /jsp

like image 191
Fallup Avatar answered Sep 21 '22 21:09

Fallup