The absolute uri: cannot be resolved in either web.xml or the jar files de

版权声明:http://guozh.net/ 《=== 秘密哦 https://blog.csdn.net/guozhaohui628/article/details/80260723

1 前言

特别蛋疼!!!就是上面问题,弄了一个晚上 才解决。在 .jsp 引入了自己写的taglib 标签。然后一直报500。

HTTP Status 500 – Internal Server Error
Type Exception Report

Message The absolute uri: cannot be resolved in either web.xml or the jar files deployed with this application

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

org.apache.jasper.JasperException: The absolute uri:  cannot be resolved in either web.xml or the jar files deployed with this application
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:55)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:293)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:80)
    org.apache.jasper.compiler.TagLibraryInfoImpl.generateTldResourcePath(TagLibraryInfoImpl.java:251)
    org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:122)
    org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:434)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1448)
    org.apache.jasper.compiler.Parser.parse(Parser.java:145)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:105)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
    org.apache.jasper.compiler.Compiler.__compile(Compiler.java:374)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:351)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:335)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:601)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:368)
    org.apache.jasper.servlet.JspServlet._serviceJspFile(JspServlet.java:385)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
Note The full stack trace of the root cause is available in the server logs.

如果你也是如上情况,只能说你幸运,网上报类似的错误全是 jstl taglib 出问题,并不是自定义的 taglib 。所以他们的方法全不行,几乎搜遍全网。

2 解决

很简单的错误,因为我用的是 IDEA ,所以把自定义的标签 tld 放到和 js jsp css 同一层级下的
webapp 下。所以报如上错误。正确的做法是 将 tld 放到 WEB-INF 下。
希望能帮到你!

展开阅读全文

http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar ............

01-01

源代码如下:rn<%@page contentType="text/html; charset=GBK"%>rn<%@taglib prefix="c" uri="http://java.sun.com/jstl/core" %>rn<%@taglib prefix="sql" uri="http://java.sun.com/jstl/sql"%>rnrnrnrnrn...rn...rn...rnrnrn如果把两句taglib去掉的话就运行正常,不去掉的话就出现如下错误:rnorg.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this applicationrn org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)rn org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:411)rn org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:118)rn org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:316)rn org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:147)rn org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)rn org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)rn org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)rn org.apache.jasper.compiler.Parser.parse(Parser.java:126)rn org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)rn org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)rn org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn请指点,谢谢!!! 论坛

没有更多推荐了,返回首页