Search code examples
jspjstl

Why can't my jsp page resolve inclusion of jsp taglibs using https instead of http?


I have recently had to update all of my imports in a web application from http to https, due to company security updates. But my jstl imports will not work. Here is an example. The only change I've made is adding an s. Top line is how it was, bottom line is how it is now:

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

I expected this to work, as the tutorial from this link uses https in the exact way I try to do. Copy/pasted, in case the link goes dead:

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

But my web application server throws this exception now:

Caused by: org.apache.jasper.JasperException: JBWEB004113: The absolute uri: https://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:57)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:278)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:75)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:218)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:124)
    at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:412)
    at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475)
    at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1456)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:143)
    at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:223)
    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
    at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:200)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:652)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:402)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:346)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
    at io.undertow.jsp.JspFileHandler.handleRequest(JspFileHandler.java:32)
    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:266)
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:201)
    at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImpl(RequestDispatcherImpl.java:202)
    at io.undertow.servlet.spec.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:109)
    at servlet.EditorFrontControllerServlet.service(EditorFrontControllerServlet.java:54)
    ... 28 more

Any ideas of why this is not working? Or how to resolve it?


Solution

  • The URI of a taglib is only an indentifier, it's not used to get any resource. They are defined in the JSTL spec:

    JSTL Tag Libraries

    So the URIs must be exactly that.