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
You've got wrong import, it should be :
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
You forgot about /jsp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With