Package javax.faces.context

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


          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

           message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
               messageStr,
               messageStr);
         }
         context.getExternalContext().log(message.getSummary(), result);
         context.addMessage(getClientId(context), message);
         context.renderResponse();
       } catch (IllegalArgumentException e) {
         FacesMessage message =
           MessageUtil.getMessage(context, UIInput.UPDATE_MESSAGE_ID,
               new Object[] { MessageUtil.getLabel(
View Full Code Here

         FacesMessage message =
           MessageUtil.getMessage(context, UIInput.UPDATE_MESSAGE_ID,
               new Object[] { MessageUtil.getLabel(
                   context, this) });
         context.getExternalContext().log(message.getSummary(), e);
         context.addMessage(getClientId(context), message);
         context.renderResponse();
       } catch (Exception e) {
         FacesMessage message =
           MessageUtil.getMessage(context, UIInput.UPDATE_MESSAGE_ID,
               new Object[] { MessageUtil.getLabel(
View Full Code Here

         FacesMessage message =
           MessageUtil.getMessage(context, UIInput.UPDATE_MESSAGE_ID,
               new Object[] { MessageUtil.getLabel(
                   context, this) });
         context.getExternalContext().log(message.getSummary(), e);
         context.addMessage(getClientId(context), message);
         context.renderResponse();
       }
     }
   }
View Full Code Here

           
            if (viewRoot.isTransient() && facesContext.isProjectStage(ProjectStage.Development)) {
                FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_WARN,
                    "@ViewScoped beans are not supported on stateless views",
                    "@ViewScoped beans are not supported on stateless views");
                facesContext.addMessage(viewRoot.getClientId(facesContext), message);               

                if (LOGGER.isLoggable(Level.WARNING)) {
                    LOGGER.log(Level.WARNING, "@ViewScoped beans are not supported on stateless views");
                }
            }
View Full Code Here

        FacesContext context = FacesContext.getCurrentInstance();
        FacesMessage message =
           MessageUtils.getErrorMessage(context,
                                        "COULD_NOT_DELETE",
                                        new Object[]{me.getMessage()});
        context.addMessage(null, message);

      }
    }
    else
    {
View Full Code Here

  }

  private void _showSendException(Exception e)
  {
    FacesContext context = FacesContext.getCurrentInstance();
    context.addMessage(null,
                       new FacesMessage(FacesMessage.SEVERITY_ERROR,
                                        e.getMessage(), null));
    _LOG.log(Level.WARNING, "Couldn't send message", e);
  }
View Full Code Here

    {
      FacesMessage errorMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR,
                                                   e.getMessage(), null);

      FacesContext context = FacesContext.getCurrentInstance();
    context.addMessage(null, errorMessage);

      return null;
    }

    return "success";
View Full Code Here

                          FacesMessage.SEVERITY_ERROR,
                          me.getMessage(),
                          me.getStackTrace().toString());

        FacesContext context = FacesContext.getCurrentInstance();
        context.addMessage(null, errorMessage);
      }
    }
  }

  private Folder    _folder;
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.