Unknown spring tags

18,061

Solution 1

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

Include that line at top of yr file

Solution 2

You're missing spring taglib declaration:

 <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
Share:
18,061
user1007895
Author by

user1007895

Updated on June 06, 2022

Comments

  • user1007895
    user1007895 about 2 years

    I downloaded springsource tools suite, and created a springMVC template project (hello world). Worked great. I just added a simple form, and the spring tags don't seem to work. STS doesn't recognize the tags, and they don't render on the page correctly when I load it. Any ideas?

    simpleForm.jsp:

    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!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>
    <form:form action="formOutput.html" commandName="user">
        <table align="center">
            <tr>
                <td>Username:</td>
                <td><form:input path="userName" /></td>
            </tr>
            <tr>
                <td>First Name:</td>
                <td><form:input path="firstName" /></td>
            </tr>
            <tr>
                <td>Last Name:</td>
                <td><form:input path="lastName" /></td>
            </tr>
            <tr>
                <td>Email:</td>
                <td><form:input path="email" /></td>
            </tr>
            <tr>
                <td>Mobile Number:</td>
                <td><form:input path="mobile" /></td>
            </tr>
            <tr>
                <td></td>
                <td><input type="submit" value="Submit" /></td>
            </tr>
        </table>
    </form:form>
    </body>
    </html>
    

    enter image description here

    Any ideas?