Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unknown tags and undefined functions in JSP fragments

I imported a web project build in JSP, which I am relatively new to. I got some errors in WEB-INF/includes/components that I am unable to resolve.

Some .jspf files show me errors such as at that line:

<c:if test="${fn:length(view.parent.views) > 1}">

the error is:

Multiple annotations found at this line:
- The function fn:length is 
 undefined
- Unknown tag (c:if).

I also get errors like The function fn:length is undefined errors for fn:length.

I followed up with other questions and made sure that standard.jar and jstl-1.2.jar are included in my build path. Moreover, WEB-INF/includes/taglibs.jspf has the following :

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
like image 566
Mohamed Khamis Avatar asked Dec 19 '25 23:12

Mohamed Khamis


1 Answers

It works if I add the following at the beginning of my JSP file:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 
<%@ taglib prefix="nav" uri="/WEB-INF/taglibs/navigation.tld" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

This is a working answer for now, but I think the best answer would be the one that tells how it can be sufficient to include the lines above in taglibs.jspf, instead of having them in every .jsp file.

like image 61
Mohamed Khamis Avatar answered Dec 22 '25 15:12

Mohamed Khamis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!