Precompile jsp files

I will precompile some jsp files using the ant jspc task, but it did not work.

errers: info.jsp (35,2) The fn attribute prefix does not match any imported tag library

info.jsp line 35:

<c:if test="${fn:length(requestScope.checkDetailInfoList) gt 1}">

ant xml task:

<jasper validateXml="false" uriroot="${basedir}/WebRoot" 
            webXmlFragment="${dir.WEB-INF}/generated_web.xml" 
            outputDir="${dir.WEB-INF}/src" />

How do i fix it?

+3
source share
2 answers

You need to make sure the jsp file imports the fnJSTL namespace . You will need a line that looks something like this in the jsp file:

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

In addition, you must ensure that jSTL banks ( jstl.jarand standard.jar) are in your classpath when jasper tries to compile.

+4
source

.

: <fn> tag JSTL. , jstl.jar standard.jar, .

+2

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


All Articles