然后将jetty9.3.xx升级到jetty9.4.xx无法读取jar文件中的自定义tld

时间:2018-12-04 03:21:30

标签: eclipse maven jetty

pom.xml

<plugin>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>${jetty.version}</version>
    <configuration>
    <webApp>
            <contextPath>/</contextPath>
            <defaultsDescriptor>${project.basedir}/src/main/resources/jetty-web.xml</defaultsDescriptor>
            <webInfIncludeJarPattern>.*/.*spring-webmvc-[^/]*\.jar$|.*/.*ithink-[^/]*\.jar$|.*/.*jsp-api-[^/]*\.jar$|.*/.*jsp-[^/]*\.jar$|.*/.*taglibs[^/]*\.jar$</webInfIncludeJarPattern>
        </webApp>
        <stopKey>stop</stopKey>
        <stopPort>9080</stopPort>
        <httpConnector>
            <port>8080</port>
            <idleTimeout>60000</idleTimeout>
        </httpConnector>
    </configuration>
</plugin>

和我的ithink-service-1.0.0.jar具有src / main / resources / META-INF / custom.tld,并且在WEB-INF / lib中具有spring-webmvc-5.1.3.jar。

--WEB-INF/lib
--|spring-webmvc-5.1.3.jar
--|ithink-service-1.0.0.jar
--|...

如果我使用jetty-maven-plugin 9.3.xx,一切顺利,可以使用spring和我的custom.tld。

<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="custom" uri="http://www.ithink.com/webui/tags"%>

如果我使用jetty-maven-plugin 9.4.xx,是错误的,jetty可以读取spring tld,但没有我的custom.tld。

javax.servlet.ServletException: org.apache.jasper.JasperException: The absolute uri: [http://www.ithink.com/webui/tags] cannot be resolved in either web.xml or the jar files deployed with this application
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)

感谢您的帮助,我该如何配置?

我的tld文件

<?xml version="1.0" encoding="UTF-8"?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
        version="2.0">
    <description>webui</description>
    <tlib-version>3.0</tlib-version>
    <short-name>ithink</short-name>
    <uri>http://www.ithink.com/webui/tags</uri>
    <tag>

0 个答案:

没有答案
相关问题