【问题标题】:Spring adding Tags build errorSpring添加标签构建错误
【发布时间】:2012-01-04 20:36:55
【问题描述】:

我有以下错误,我无法找到答案。有人可以在这里帮助我吗?

描述资源路径位置类型 找不到“http://www.springframework.org/tags”的标签库描述符contact.jsp/Spring3HibernateMaven/src/main/webapp/WEB-INF/jsp line 1 JSP问题

描述资源路径位置类型 找不到“http://www.springframework.org/tags/form”的标签库描述符contact.jsp/Spring3HibernateMaven/src/main/webapp/WEB-INF/jsp line 2 JSP问题

我的JSP代码如下;

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

在我的Web.xml中代码如下;

 <jsp-config>
    <taglib>
        <taglib-uri>http://www.springframework.org/tags/form</taglib-uri>
        <taglib-location>spring-form.tld</taglib-location>
    </taglib>
</jsp-config>

我该如何解决这个错误?

【问题讨论】:

    标签: java eclipse spring jsp


    【解决方案1】:

    您不需要在 web.xml 中配置 taglib。只需确保 org.springframework.web.servlet-xxx.jar 在您的类路径(web-inf/lib)上。它包含 TLD 文件。

    【讨论】:

      【解决方案2】:

      虽然我已经在 Maven 存储库上安装了 spring-webmvc-3.1.0.RELEASE.jar,但我也遇到了同样的问题。 当我下载 jar org.springframework.web.servlet-3.1.0.RELEASE.jar 并包含在 lib 中时。它有效。

      我不知道为什么,因为两个罐子完全一样,只是名字不同。

      【讨论】:

        猜你喜欢
        • 2017-05-29
        • 1970-01-01
        • 2021-06-07
        • 1970-01-01
        • 2020-06-06
        • 2015-01-06
        • 1970-01-01
        • 2022-08-16
        • 1970-01-01
        相关资源
        最近更新 更多