
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> <head> <title>Celebrity Collector: Registration</title> </head> <body> <h1>Registration</h1> <t:form t:id="registrationForm"> <table> <tr> <td><t:label t:for="userName"> Label for user name</t:label>:</td> <td><input type="text" t:type="textfield" t:id="userName" t:value="userName"/></td> </tr> <tr> <td><t:label t:for="password"> Label for password</t:label>:</td> <td><input type="text" t:type="passwordfield" t:id="password" t:value="password"/></td> </tr> <tr> <td><t:label t:for="password2"> Label for password 2</t:label>:</td> <td><input type="text" t:type="passwordfield" t:id="password2" t:label="Repeat password" t:value="password2"/></td> </tr> <tr> <td>Gender:</td> <td> <t:radiogroup t:value="gender"> <input type="radio" t:type="radio" t:value="literal:M"/> Male <input type="radio" t:type="radio" t:value="literal:F"/> Female </t:radiogroup> </td> </tr> </table> <input type="submit" value="Submit"/> </t:form> <br/> <a href="#" t:type="PageLink" t:page="Start"> Back to the Start Page</a> </body> </html>
除了下面的这些代码其他的都很熟悉了
package com.packtpub.celebrities.pages;
public class Registration
{
private String userName;
private String password;
private String password2;
private String gender;
public String getUserName()
{
return userName;
}
public void setUserName(String userName)
{
System.out.println("Setting user name: " + userName);
this.userName = userName;
}
public String getPassword()
{
return password;
}
public void setPassword(String password)
{
System.out.println("Setting password: " + password);
this.password = password;
}
public String getPassword2()
{
return password2;
}
public void setPassword2(String password2)
{
this.password2 = password2;
}
public String getGender()
{
return gender;
}
public void setGender(String gender)
{
System.out.println("Setting gender: " + gender);
this.gender = gender;
}
}
发表于 @ 2008年07月11日 15:41:00 | 评论( loading... ) | 举报| 收藏