[Tapestry5] T5,Component Login does not contain an embedded component with id 'form'.是什么错误?

guanyq 2007-11-01
Component Login does not contain an embedded component with id 'form'.
是什么原因导致的,有人能给定位下么?
html文件:
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
    <head>
        <title>Login</title>
    </head>
    <body>
        <h1>Please Login</h1>

        <form t:id="form" t:type="form">

            <t:errors/>

            <t:label for="userName"/>:
            <input t:type="TextField" t:id="userName" t:validate="required,minlength=3" size="30"/>
            <br/>
            <t:label for="password"/>:
            <input t:type="PasswordField" t:id="password" t:validate="required,minlength=3" size="30"/>
            <br/>
            <input type="submit" value="Login"/>
        </form>
    </body>
</html>


java文件:
package org.example.pages;

import org.apache.tapestry.annotations.Component;
import org.apache.tapestry.annotations.Persist;
import org.apache.tapestry.corelib.components.Form;

public class Login {
@Persist
private String _userName;

private String _password;

@Component
private Form _form;

String onSuccess() {

_form.recordError("Invalid user name or password.");
return null;

}

public String getPassword() {
return _password;
}

public void setPassword(String password) {
_password = password;
}

public String getUserName() {
return _userName;
}

public void setUserName(String userName) {
_userName = userName;
}
}
lococode 2007-11-05
@Component
private Form _form;


需要和
<form t:id="form" t:type="form">

id匹配
Global site tag (gtag.js) - Google Analytics