package no.northcreek.mabjo;
import javax.annotation.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.RequestScoped;
@ManagedBean
@RequestScoped
public class indexBean {
@ManagedProperty(value="defaultValue")
private String firstName;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
}
所以上面是我希望创建默认值为“defaultValue”的 firstName 成员变量的代码。但是该值为空。为什么?