简体   繁体   English

预编译jsp文件发生异常

[英]pre-compile jsp files happend exceptions

I pre-compile some jsp files through ant task of jspc,but it built failed. 我通过jspc的ant任务预编译了一些jsp文件,但它构建失败了。

errers: info.jsp(35,2) The attribute prefix fn does not correspond to any imported tag library errers:info.jsp(35,2)属性前缀fn与任何导入的标记库都不对应

info.jsp line 35 : info.jsp第35行:

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

ant task xml: ant任务xml:

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

How should I correct? 我该怎么说?

You need to make sure the jsp file imports the fn namespace of the JSTL. 您需要确保jsp文件导入JSTL的fn名称空间。 You'll need a line that looks something like this in your jsp file: 在jsp文件中你需要一行看起来像这样的行:

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

Also, you'll need to make sure the JSTL jars ( jstl.jar and standard.jar ) are in your classpath when jasper tries to compile. 此外,当jasper尝试编译时,您需要确保JSTL jar( jstl.jarstandard.jar )在您的类路径中。

Asaph's comments are spot on. Asaph的评论是现货。

There's one other bit to check: The <fn> tag set was a later addition to the JSTL libraries. 还有一点需要检查:<fn>标记集是JSTL库的后续添加。 Maybe you have an older version of jstl.jar and standard.jar that needs to be updated. 也许你有一个旧版本的jstl.jar和standard.jar需要更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM