我的頁面:自定義消息(JSF)
...
<div id="header">
<!-- content header -->
</div>
<div id="content">
<h:messages />
<h:ouputText value="#{example.text}" />
</div>
...
我managedBean:
public class ExampleManagedBean(){
private String text;
public String getText(){
FacesContext.getCurrentInstance().
addMessage(null,
new FacesMessage(FacesMessage.SEVERITY_WARN,
"Warning message...", null));
return text;
}
public void setText(String text){
this.text = text;
}
}
我的問題是,不是就是警告消息呈現在頁面中。爲什麼?
有沒有''?頁面是否刷新? –
Bozho
2010-02-26 11:23:35
是的,有一個。 頁面未被刷新,因爲它是第一頁。 –
bblanco
2010-03-02 08:57:27
@Bozho:是否需要''來彈出顯示消息? –
Rachel
2012-04-11 18:07:12