您好,我正在尝试根据我从上一页传递的参数加载 jsf 页面。
我在 url 中传递参数并尝试在第二页托管 bean 的 @PostConstruct 方法中读取它以确定在第二页中显示的内容。
我传递的参数已经在第二页的托管 bean 中定义如下:
@ManagedProperty("#{param.displayText}")
String displayText;
但问题是,当我尝试在 @PostConstruct 方法中读取 displayText 的值时,它仍然设置为 null。
我注意到,在执行 @PostConstruct 方法时,托管 bean 中的所有字段仍设置为 null。
请问有什么帮助,除了@PostConstruct,我还应该使用其他方法吗?