Java – core and core_ Differences between RT and JSTL Tags
When I use <% @ taglib URI = "http: / / Java. Sun. COM / JSP / JSTL / core" prefix = "C"% > for my struts 1.3 10 project, which throws the following exception:
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:311) org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:152) 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:646) 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:728) org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1083) org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:295) org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:396) org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:347) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:232) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462) javax.servlet.http.HttpServlet.service(HttpServlet.java:647) javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
Then, when I change it
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
It works normally I want to know when I try to use <% @ taglib URI=“ http://java.sun.com/jsp/jstl/core ”When prefix = "C", what is the difference between the two and why it throws an exception% instead By the way, I use the server apache-tomcat-7.0 42. Please help me
Solution
Unless you are using a very old version of JSP (specifically JSP 1.2 or 1.1), you should not use either These are JSTL 1.0 URIs and are not suitable for modern versions of JSP
The difference between the two libraries is that one allows runtime expressions as tag attribute values, while the other does not In modern JSP and JSTL, the JSP engine evaluates all expressions, and it is no longer relevant