【问题标题】:org.apache.jasper.JasperException: File "/WEB-INF/spring-form.tld" not foundorg.apache.jasper.JasperException:找不到文件“/WEB-INF/spring-form.tld”
【发布时间】:2015-04-09 10:26:57
【问题描述】:

嗨,我正在使用 Spring mvc、servlet、jsp、oracle 我收到此错误:'org.apache.jasper.JasperException: File "/WEB-INF/spring-form.tld" not found' 谁能告诉我如何解决这个问题 我的jsp页面看起来像

ContactForm.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> --%>

   

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

<div align="center">
        <h1>New/Edit Contact</h1>
        <form:form action="saveContact" method="post" modelAttribute="contact">
        <table>
            <form:hidden path="id"/>
            <tr>
                <td>Name:</td>
                <td><form:input path="name" /></td>
            </tr>
            <tr>
                <td>Email:</td>
                <td><form:input path="email" /></td>
            </tr>
            <tr>
                <td>Address:</td>
                <td><form:input path="address" /></td>
            </tr>
            <tr>
                <td>Telephone:</td>
                <td><form:input path="telephone" /></td>
            </tr>
            <tr>
                <td colspan="2" align="center"><input type="submit" value="Save"></td>
            </tr>
        </table>
        </form:form>
    </div>
</body>
</html>

【问题讨论】:

    标签: java spring jsp spring-mvc servlets


    【解决方案1】:

    tld 文件并放在 WEB-INF 文件夹中。

    【讨论】:

    • 下载 spring-tld 文件并放在您的 WEB-INF 文件夹中
    • 同时下载 spring-form.tld
    • 在包含两个 jar 之后它说 form:from 标签可以找到
    【解决方案2】:

    下载 Jar : spring-webmvc-3.0.x.RELEASE.jar 并将其放入您的构建路径中,或者如果您正在使用 maven 项目,请在您的 pom.xml 中添加以下条目:

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>3.2.13.RELEASE</version>
    </dependency>
    

    这个 jar 包含 Spring 表单标签库。

    【讨论】:

    • 尝试将 springframework.org/tags"%> 放入您的 JSP 文件中
    • 找不到“springframework.org/tags”的标签库描述符
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-09
    • 1970-01-01
    • 1970-01-01
    • 2023-03-21
    • 1970-01-01
    • 2017-07-02
    相关资源
    最近更新 更多