Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unknown spring tags

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?

like image 299
user1007895 Avatar asked Jan 30 '12 16:01

user1007895


2 Answers

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

Include that line at top of yr file

like image 175
NimChimpsky Avatar answered Oct 11 '22 17:10

NimChimpsky


You're missing spring taglib declaration:

 <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
like image 42
soulcheck Avatar answered Oct 11 '22 19:10

soulcheck