更新时间:2023-02-19 11:08:58
带有 target ="_ blank"
属性的< h:commandLink/>
怎么样:
<h:commandLink action="#{bean.action}" target="_blank" value="Open document"/>
在您的bean中:
public void action() {
try {
FacesContext.getCurrentInstance().getExternalContext()
.redirect("page2.xhtml");
} catch (IOException ex) {
// do something here
}
}
用目标网址替换 page2.xhtml
.