我有以下
public enum Gender {MALE, FEMALE}
和
public class Person {
private String name;
private Gender gender;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Gender getGender() {
return gender;
}
public void setGender(Gender gender) {
this.gender = gender;
}
}
在 FreeMarker 模板中${person.name}
工作正常,但${person.gender}
给出Expression person.gender is undefined on ...
.
知道为什么吗?