JSTL functions not found in JSF

I am trying to add an active class to the page that the user is viewing, but I cannot use the JSTL functions. What am I doing wrong?

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

Using it in h:link

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

causes this error:

styleClass="#{fn:containsIgnoreCase(request.requestURI,'index')}" Function 'fn:containsIgnoreCase' not found
+5
source share
1 answer

You have the wrong import, it should be:

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

You forgot about / jsp

+11
source

All Articles