从更新到Jetty 9.2.2.v20140723后,`WEB-INF / lib`文件夹中的库中包含的标记停止工作

时间:2014-08-05 11:30:37

标签: jetty jsp-tags maven-jetty-plugin

我将Jetty(和Jetty Maven插件)从9.2.1.v20140609更新为9.2.2.v20140723,现在当我尝试访问我的应用程序的任何网页时抛出此异常:

org.apache.jasper.JasperException: /WEB-INF/(...).jsp (line: 2, column: 0)
The absolute uri: http://www.springframework.org/security/tags cannot be resolved
in either web.xml or the jar files deployed with this application

目前我使用

<%@ taglib uri="http://www.springframework.org/security/tags" prefix="security"%>

在所有JSP文件的顶部,Spring Security标记包含在WAR文件中:

ROOT.war content

当我从JAR中提取*.tld文件时,请输入WEB-INF并使用

手动包含它
<jsp-config>
        <taglib>
            <taglib-uri>http://www.springframework.org/security/tags</taglib-uri>
            <taglib-location>security.tld</taglib-location>
        </taglib>
</jsp-config>

web.xml中,它又开始工作了。但我必须为所有图书馆的所有标签做这件事......

似乎Jetty以某种方式停止扫描WEB-INF/lib *.tld个文件。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

好的,我明白了。

pom.xml我有

<plugin>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>${jetty.version}</version>

    <configuration>
        <!-- (...) --->
        <contextXml>${basedir}/path/to/jetty-context.xml</contextXml>-->
        <!-- (...) --->
    <configuration>
</plugin>

并在jetty-context.xml我有

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
    <Set name="maxFormKeys">8000</Set>
    <Call name="setAttribute">
        <Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg>
        <Arg>.*/.*jsp-api-[^/]\.jar$|./.*jsp-[^/]\.jar$|./.*taglibs[^/]*\.jar$</Arg>
    </Call>
</Configure>

从POM和<contextXml>移除了<{1}} {/ 1}},一切正常。