为什么我的jsp页面无法使用https而不是http解决包含jsp taglib的问题?

问题描述 投票:0回答:1

由于公司安全更新,我最近不得不将Web应用程序中的所有导入内容从http更新为https。但是我的jstl导入将不起作用。这是一个例子。我所做的唯一更改是添加了s。顶行是它的样子,底线是现在的样子:

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

我希望这能正常工作,因为the tutorial from this link会以我尝试的确切方式使用https。复制/粘贴,以防链接失效:

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

但是我的Web应用程序服务器现在抛出此异常:

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

关于为什么这行不通的任何想法?或如何解决?

jsp jstl
1个回答
0
投票

taglib的URI只是一个标识符,它不用于获取任何资源。它们在JSTL规范中定义:

JSTL Tag Libraries

因此URI必须完全是这样。

© www.soinside.com 2019 - 2024. All rights reserved.