Search in sources :

Example 66 with FacesMessage

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);
}
Also used : FacesMessage(javax.faces.application.FacesMessage)

Example 67 with FacesMessage

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";
}
Also used : FacesMessage(javax.faces.application.FacesMessage)

Example 68 with FacesMessage

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."));
}
Also used : FacesMessage(javax.faces.application.FacesMessage)

Example 69 with FacesMessage

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";
}
Also used : FacesMessage(javax.faces.application.FacesMessage) Date(java.util.Date)

Example 70 with FacesMessage

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;
}
Also used : FacesContext(javax.faces.context.FacesContext) FacesMessage(javax.faces.application.FacesMessage)

Aggregations

FacesMessage (javax.faces.application.FacesMessage)370 ConceptHelper (mom.trd.opentheso.bdd.helper.ConceptHelper)43 SQLException (java.sql.SQLException)40 Connection (java.sql.Connection)34 FacesContext (javax.faces.context.FacesContext)25 ArrayList (java.util.ArrayList)24 UIInput (javax.faces.component.UIInput)24 ValidatorException (javax.faces.validator.ValidatorException)24 GroupHelper (mom.trd.opentheso.bdd.helper.GroupHelper)22 NodeAutoCompletion (mom.trd.opentheso.bdd.helper.nodes.NodeAutoCompletion)22 CandidateHelper (mom.trd.opentheso.bdd.helper.CandidateHelper)19 UserHelper2 (mom.trd.opentheso.bdd.helper.UserHelper2)19 IOException (java.io.IOException)16 NoteHelper (mom.trd.opentheso.bdd.helper.NoteHelper)15 Test (org.junit.Test)13 TermHelper (mom.trd.opentheso.bdd.helper.TermHelper)12 Term (mom.trd.opentheso.bdd.datas.Term)11 UploadedFile (org.primefaces.model.UploadedFile)11 HikariDataSource (com.zaxxer.hikari.HikariDataSource)10 Date (java.util.Date)10