JSPX namespaces not visible to EL functions?

I am trying to use JSPX (pure XML syntax for JSP) and work in that it seems that it should work, but does not work. I import taglibs using namespace declarations in the jsp: root root element, then using them further for the elements as well as for the EL functions:

<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/ xmlns:c="urn:jsptld:/WEB-INF/tld/c.tld" xmlns:fn="urn:jsptld:/WEB-INF/tld/fn.tld"> ... <c:if test="${fn:length(list) &gt; 0"> ... </c:if> ... </jsp:root> 

I get an exception: "The fn attribute prefix does not match any imported tag library." Other pages work fine, but this page is different in that it uses several EL functions contained in the tag library.

Is there any other type of import I need that will bring these taglib prefixes into scope for EL function calls?

+3
source share
1 answer

Why aren't you using the full TLD URI? You can find an overview of a valid JSTL TLD URI here (click on any JSTL tag of interest to get valid declaration examples).

Of course: you put JSTL JAR files ( jstl.jar and / or standard.jar , depending on the version of JSTL, until 1.1 is with it, and in 1.2 it is only jstl.jar ) in the class path and you didn’t extract them and clutter the way to classes and / or web.xml free files and declarations, as some bad online lessons say?

+4
source

Source: https://habr.com/ru/post/1310788/


All Articles