Need to open a new tab in the browser from the java code, this is my view the code should be opened in a new tab.
public String update() {
this.conversation.end();
try {
if (this.id == null) {
this.entityManager.persist(this.voucher);
//open in new tab
return "view?faces-redirect=true&id=" + this.voucher.getId();
} else {
this.entityManager.merge(this.voucher);
//open in new tab
return "view?faces-redirect=true&id=" + this.voucher.getId();
}
} catch (Exception e) {
FacesContext.getCurrentInstance().addMessage(null,
new FacesMessage(e.getMessage()));
return null;
}
}
Aucun commentaire:
Enregistrer un commentaire