use of javax.faces.application.FacesMessage in project oxAuth by GluuFederation.
the class UmaGatherer method addMessage.
public void addMessage(FacesMessage.Severity severity, String summary) {
String msg = languageBean.getMessage(summary);
FacesMessage message = new FacesMessage(severity, msg, null);
facesContext.addMessage(null, message);
}
use of javax.faces.application.FacesMessage in project javaee7-firstcup by ecabrerar.
the class BookController method addNewBook.
public String addNewBook() {
String status = "";
try {
if (validate()) {
status = rc.addNewBook(book);
facesContext.addMessage(status, new FacesMessage(FacesMessage.SEVERITY_INFO, "New Book added successfully", book.toString()));
}
} catch (Exception ex) {
facesContext.addMessage(status, new FacesMessage(FacesMessage.SEVERITY_ERROR, "New Book cannot be added", ex.getMessage()));
}
return "register.xhtml";
}
use of javax.faces.application.FacesMessage in project quickstarts by jboss-switchyard.
the class ItemEntry method create.
public void create() {
inventory.createItem(item);
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Item " + getItemId() + " has been added."));
}
use of javax.faces.application.FacesMessage in project deltaspike by apache.
the class ArticleController method persist.
public String persist() {
article.setDate(new Date());
em.merge(this.article);
facesContext.addMessage(null, new FacesMessage("article:" + article.getTitle() + " persisted"));
return "persisted";
}
use of javax.faces.application.FacesMessage in project deltaspike by apache.
the class SecurityUtils method isMessageAddedAlready.
private static boolean isMessageAddedAlready(String message) {
FacesContext facesContext = FacesContext.getCurrentInstance();
if (facesContext == null || message == null) {
return false;
}
List<FacesMessage> existingMessages = facesContext.getMessageList();
if (existingMessages == null) {
return false;
}
for (FacesMessage facesMessage : existingMessages) {
if (message.equals(facesMessage.getSummary())) {
return true;
}
}
return false;
}
Aggregations