![](/img/trans.png)
[英]The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved
[英]“The absolute uri: http://java.sun.com/jstl/core cannot be resolved”
我一直在搜索 web 以找到适合我情况的确切原因/解决方法。 我访问了本网站上的这些其他链接:
如何安装 JSTL? 绝对uri:http://java.sun.com/jstl/core 无法解析
https://stackoverflow.com/tags/jstl/info
JSTL 1.2 绝对uri:http://java.sun.com/jsp/jstl/core 无法解析
当我尝试为我的网站构建战争文件时,仍然出现同样的错误。 早些时候它在 Tomcat 8.5.35 上工作。 我已将其更新为 Tomcat 9.0.37,这一切都付诸东流。 我已经更新了构建路径,环境变量。 我已确保所有其他文件(例如我的库和框架文件)也已更新。 我已确保 build.properties 文件具有正确的 tomcat 版本。 在 WEB-INF/web.xml 文件中,我已将 servlet 更新为 4.0,因为 Tomcat 9 支持。 我在 WEB-INF/lib 文件夹中添加了 jstl1.2.jar 以及我的站点需要的其他 jars。
例外:
[jasper] Jul 20, 2020 3:11:08 PM org.apache.jasper.servlet.TldScanner scanJars
[jasper] INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
[jasper] Jul 20, 2020 3:11:10 PM org.apache.jasper.JspC execute
[jasper] SEVERE: Compilation error
[jasper] java.util.concurrent.ExecutionException: org.apache.jasper.JasperException: The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application
[jasper] at java.util.concurrent.FutureTask.report(FutureTask.java:122)
[jasper] at java.util.concurrent.FutureTask.get(FutureTask.java:192)
[jasper] at org.apache.jasper.JspC.execute(JspC.java:1529)
[jasper] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[jasper] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[jasper] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[jasper] at java.lang.reflect.Method.invoke(Method.java:498)
[jasper] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
[jasper] at org.apache.tools.ant.Task.perform(Task.java:350)
[jasper] at org.apache.tools.ant.Target.execute(Target.java:449)
[jasper] at org.apache.tools.ant.Target.performTasks(Target.java:470)
[jasper] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1391)
[jasper] at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
[jasper] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[jasper] at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:36)
[jasper] at org.apache.tools.ant.Project.executeTargets(Project.java:1254)
[jasper] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:460)
[jasper] at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:142)
[jasper] Caused by: org.apache.jasper.JasperException: The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application
[jasper] at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:55)
[jasper] at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:294)
[jasper] at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:81)
[jasper] at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTldResourcePath(TagLibraryInfoImpl.java:251)
[jasper] at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:122)
[jasper] at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:431)
[jasper] at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:489)
[jasper] at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1445)
[jasper] at org.apache.jasper.compiler.Parser.parse(Parser.java:144)
[jasper] at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244)
[jasper] at org.apache.jasper.compiler.ParserController.parse(ParserController.java:105)
[jasper] at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:206)
[jasper] at org.apache.jasper.compiler.Compiler.compile(Compiler.java:386)
[jasper] at org.apache.jasper.JspC.processFile(JspC.java:1362)
[jasper] at org.apache.jasper.JspC$ProcessFile.call(JspC.java:1886)
[jasper] at org.apache.jasper.JspC$ProcessFile.call(JspC.java:1877)
[jasper] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[jasper] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[jasper] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[jasper] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[jasper] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[jasper] at java.lang.Thread.run(Thread.java:748)
[jasper] Error count: [1]
BUILD FAILED
抛出异常的碧玉“-compile-jsp”(来自我的 build.xml 文件)
<jasper validateXml="false" uriroot="${build.dir}/jspsrc"
webXmlFragment="${build.dir}/jspsrc/generated_web.xml"
outputDir="${build.dir}/jspjava"
xpoweredby="false" addwebxmlmappings="true"
erroronusebeaninvalidclassattribute="false"
compilersourcevm="${javac.version}" compilertargetvm="${javac.version}" />
我的 WEB-INF 的开始
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
在网站上加载的第一个页面是一个同意横幅(DoD 网站),在这里 (consent.jsp) 我有以下行:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
[编辑] 如果我删除它成功构建的这条线,这是一个问题吗?
我正在使用 Eclipse ...
如果您想看其他东西,请告诉我,请发送帮助!
回答我自己的问题,它仅在我将 JSTL 1.2 jar 打包到 tomcat 本身的 lib 文件夹中时才有效。
谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.