日期:2014-05-20 浏览次数:20753 次
package com.jspdev.ch3;
public class TestBean {
public String userName;
public String password;
public int age;
public void setUserName(String name){
this.userName=name;
}
public void setPassword(String password){
this.password=password;
}
public String getUserName(){
return this.userName;
}
public String getPassword(){
return this.password;
}
public void setAge(){
this.age=age;
}
public int getAge(){
return this.age;
}
}
//TestBean的3个属性都有对应的getter和setter方法。
<jsp:useBean id="user" scope="page" class="com.jspdev.ch3.TestBean"/>
<jsp:setProperty name="user" property="*"/>