类是这样的:
class Student
{
private String name;
private int age;
public Student(String name, int age)
{
super();
this.name = name;
this.age = age;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public int getAge()
{
return age;
}
public void setAge(int age)
{
this.age = age;
}
}
用Beanutils提供的静态方法设置属性
BeanUtils.setProperty(student, "age", "9");
异常,提示说age没有set方法。很郁闷,求解。 |
|