简体   繁体   English

JSTL:绝对uri:无法在web.xml或与此应用程序一起部署的jar文件中解析http://java.sun.com/jsp/jstl/core

[英]JSTL: 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

I am receiving the exception below when trying to access one of my JSPS (using tomcat 7.0.52) 尝试访问我的JSPS之一(使用tomcat 7.0.52)时,我收到以下异常消息

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
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:56)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:445)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:117)
    org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:325)
    org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:154)
    org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1427)
    org.apache.jasper.compiler.Parser.parse(Parser.java:138)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
    org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:264)
    org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208)
    org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:915)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:811)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:796)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

Yes I have seen several questions on the same topic, but none have seemed to resolve my issue. 是的,我在同一主题上看到了几个问题,但似乎都没有一个问题可以解决。 So in my JSP I have 所以在我的JSP中

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

In my Web XML I have 在我的Web XML中,

<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

And in my Maven POM I have 在我的Maven POM中,

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.5</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
    <scope>provided</scope>
</dependency>

In the list of my maven resources I have the jstl-1.2.jar and no standard.jar as some of the answers I've seen seem to suggest can confuse things. 在我的Maven资源列表中,我有jstl-1.2.jar,而没有standard.jar,因为我看到的一些答案似乎会使事情混淆。

EDIT: Ok I did read the answer below, but it did seem to be a copy and paste from bits of other answers I had read and didn't actually take in to account any of the information I had put in my question (for example /jsp WAS part of my URI) 编辑:好的,我确实阅读了下面的答案,但是它似乎确实是从我阅读的其他答案中复制并粘贴的,实际上并没有考虑到我在问题中输入的任何信息(例如/ jsp是我的URI的一部分)

Anyway I seem to have sorted it by removing the app completely from my server and re-adding it! 无论如何,我似乎已经通过从服务器上完全删除应用程序并重新添加来对它进行排序! I'm not sure why stopping the server and republishing it didn't seem to work, but never mind it's working! 我不确定为什么停止服务器并重新发布它似乎没有用,但是没关系,它在起作用!

I think its about your pom conf and lib files. 我认为这与您的pom conf和lib文件有关。

Try this one by one 一一尝试

1.Add these to your POM.xml and delete your jstl. 1.将它们添加到您的POM.xml并删除您的jstl。 Save POM and right click the project Maven >> Update 保存POM,然后右键单击项目Maven >>更新

<!-- Servlet -->
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.5</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>javax.servlet.jsp</groupId>
    <artifactId>jsp-api</artifactId>
    <version>2.1</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
</dependency>

2.Delete jstl lib in your libraries. 2.删除库中的jstl lib。

3.Control Apache Tomcat do you have = ? 3.Control Apache Tomcat你有=吗? servlet-api.jar ,jsp-api.jar servlet-api.jar,jsp-api.jar

暂无
暂无

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

相关问题 绝对的uri:http://java.sun.com/jsp/jstl/core无法在web.xml或使用此应用程序部署的jar文件中解析 - The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this app JSTL错误:绝对uri:http://java.sun.com/jsp/jstl/core不能在web.xml或与此应用程序一起部署的jar文件中解析 - JSTL error: 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 绝对uri:http://java.sun.com/jsp/jstl/core不能在web.xml或tomcat中与此应用程序错误一起部署的jar文件中解决 - Absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application error in tomcat JBoss 6x绝对uri:http://java.sun.com/jsp/jstl/core不能在web.xml或与此应用程序一起部署的jar文件中解析 - JBoss 6x 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 错误HTTP状态500-绝对URI:无法在web.xml或jar文件中解析http://java.sun.com/jsp/jstl/core - Error HTTP Status 500 - The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files 如何解决&#39;绝对uri:http://java.sun.com/portlet无法在web.xml或使用此应用程序部署的jar文件中解析&#39; - How to fix 'The absolute uri: http://java.sun.com/portlet cannot be resolved in either web.xml or the jar files deployed with this application' 绝对URI:无法解析http://java.sun.com/jsp/jstl/core - The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved Jetty 9.0 绝对uri:http://java.sun.com/jsp/jstl/core 无法解析 - Jetty 9.0 The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved 绝对URI:[http://java.sun.com/jsp/jstl/core]无法解决错误 - The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved error Apache Tomcat 10.0.0-M1 使用 JSP Absolute uri http://java.sun.com/jsp/jstl/core 无法解析 - Apache Tomcat 10.0.0-M1 using JSP Absolute uri http://java.sun.com/jsp/jstl/core cannot be resolved
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM