Package javax.faces.context

Examples of javax.faces.context.FacesContext.addMessage()


  @Before
  public void setUp() throws Exception {
    super.setUp();
    FacesContext facesContext = getFacesContext();
    facesContext.addMessage("id0", new FacesMessage(FacesMessage.SEVERITY_INFO, "test", "a test"));
    facesContext.addMessage("id0", new FacesMessage(FacesMessage.SEVERITY_WARN, "test", "a test"));
    facesContext.addMessage("id1", new FacesMessage(FacesMessage.SEVERITY_ERROR, "test", "a test"));
    facesContext.addMessage("id1", new FacesMessage(FacesMessage.SEVERITY_FATAL, "test", "a test"));
    facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "test", "a test"));
  }
View Full Code Here


  public void setUp() throws Exception {
    super.setUp();
    FacesContext facesContext = getFacesContext();
    facesContext.addMessage("id0", new FacesMessage(FacesMessage.SEVERITY_INFO, "test", "a test"));
    facesContext.addMessage("id0", new FacesMessage(FacesMessage.SEVERITY_WARN, "test", "a test"));
    facesContext.addMessage("id1", new FacesMessage(FacesMessage.SEVERITY_ERROR, "test", "a test"));
    facesContext.addMessage("id1", new FacesMessage(FacesMessage.SEVERITY_FATAL, "test", "a test"));
    facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "test", "a test"));
  }

  @Test
View Full Code Here

    super.setUp();
    FacesContext facesContext = getFacesContext();
    facesContext.addMessage("id0", new FacesMessage(FacesMessage.SEVERITY_INFO, "test", "a test"));
    facesContext.addMessage("id0", new FacesMessage(FacesMessage.SEVERITY_WARN, "test", "a test"));
    facesContext.addMessage("id1", new FacesMessage(FacesMessage.SEVERITY_ERROR, "test", "a test"));
    facesContext.addMessage("id1", new FacesMessage(FacesMessage.SEVERITY_FATAL, "test", "a test"));
    facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "test", "a test"));
  }

  @Test
  public void testCreateMessageListAll() {
View Full Code Here

    FacesContext facesContext = getFacesContext();
    facesContext.addMessage("id0", new FacesMessage(FacesMessage.SEVERITY_INFO, "test", "a test"));
    facesContext.addMessage("id0", new FacesMessage(FacesMessage.SEVERITY_WARN, "test", "a test"));
    facesContext.addMessage("id1", new FacesMessage(FacesMessage.SEVERITY_ERROR, "test", "a test"));
    facesContext.addMessage("id1", new FacesMessage(FacesMessage.SEVERITY_FATAL, "test", "a test"));
    facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, "test", "a test"));
  }

  @Test
  public void testCreateMessageListAll() {
View Full Code Here

      }
      LOG.error("Processing failed. Forwarding to error page. errorOutcome=" + errorOutcome, e.getCause());
      FacesContext facesContext = FacesContext.getCurrentInstance();
      if (e.getCause() != null) {
         FacesMessage facesMessage = new FacesMessage(e.getCause().toString());
         facesContext.addMessage(null, facesMessage);
      }
      UIComponent source = event.getComponent();
      ActionSource2 actionSource = (ActionSource2) source;
      Application application = facesContext.getApplication();
      MethodExpression expression = actionSource.getActionExpression();
View Full Code Here

      catch (Exception e)
      {
        hsr.reset();
        _LOG.warning(e);      
        FacesMessage message = MessageFactory.getMessage(context, DOWNLOAD_MESSAGE_ID);
        context.addMessage(null, message);
        context.renderResponse();
        return;
      }
    }
   
View Full Code Here

    if (activeMQReporting != null) {
      new WebServiceResult(activeMQReporting.get("queueName"), activeMQReporting.get("id"), nurInfo ? ReportLevel.INFO : ReportLevel.ERROR,
          compoundMessage).send();
    }
    if (context != null) {
      context.addMessage(control, new FacesMessage(nurInfo ? FacesMessage.SEVERITY_INFO : FacesMessage.SEVERITY_ERROR, msg, beschr));
    } else {
      // wenn kein Kontext da ist, dann die Meldungen in Log
      myLogger.log(nurInfo ? Level.INFO : Level.ERROR, compoundMessage);

    }
View Full Code Here

          setValid(false);
          String messageString = e.toString();
          e.printStackTrace();
          FacesMessage message = new FacesMessage(messageString);
          message.setSeverity(FacesMessage.SEVERITY_ERROR);
          facesContext.addMessage(getClientId(facesContext),
              message);
          facesContext.renderResponse();
        }
      } else {
        super.broadcast(event);
View Full Code Here

        // XXX add message
        FacesMessage message = new FacesMessage(
            "preloadDateRangeBegin is greater than preloadDateRangeEnd");
        message.setSeverity(FacesMessage.SEVERITY_ERROR);
        FacesContext context = FacesContext.getCurrentInstance();
        context.addMessage(getClientId(context), message);
        throw new IllegalArgumentException();
      }

      List <Date> dates = new ArrayList<Date>();
View Full Code Here

                try {
                    jbpmJsfContext.getJbpmContext().setRollbackOnly();
                } catch (Exception ex2) {
                    log.log(Level.WARNING, "Failed to set rollback on jBPM context after close failed", ex2);
                }
                context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Closing the database context " +
                    "failed", "An exception of type " + ex.getClass().getName() + " was thrown, with the message: " +
                    ex.getMessage()));
                return;
            }
            commitTxnMessages(context, jbpmJsfContext);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.