Package de.odysseus.calyxo.base

Examples of de.odysseus.calyxo.base.Messages


   * if the requested messages are not present
   * @param key request scope messages key
   * @return messages instance or <code>null</code>
   */
  protected Messages get(HttpServletRequest request, boolean create, String key) {
    Messages messages = (Messages)request.getAttribute(key);
    if (messages == null && create) {
      request.setAttribute(key, messages = new Messages());
    }
    return messages;
  }
View Full Code Here


    ActionErrors errors = null;
    // execute validation
    FormResult result = form.validate(request, inputs);
    if (!result.isValid()) { // collect error messages
      errors = new ActionErrors();
      Messages messages = result.getMessages();
      Iterator names = messages.getKeys();
      while (names.hasNext()) {
        String name = (String)names.next();
        if (name != Messages.GLOBAL_KEY) {
          Message message = messages.getFirstMessage(name);
          ActionMessage error =
            createActionMessage(request, locale, i18n, message);
          errors.add(name, error);
        } else {
          Iterator iter = messages.getGlobalMessages();
          while (iter.hasNext()) {
            Message message = (Message)iter.next();
            ActionMessage error =
              createActionMessage(request, locale, i18n, message);
            errors.add(ActionMessages.GLOBAL_MESSAGE, error);
View Full Code Here

TOP

Related Classes of de.odysseus.calyxo.base.Messages

Copyright © 2018 www.massapicom. 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.