Package org.springframework.binding.message

Examples of org.springframework.binding.message.MessageResolver


                messageBuilder.error();
                messageBuilder.source("attributes[" + attribute + "].value");
                messageBuilder.code("personLookup.invalidQueryAttribute");
                messageBuilder.arg(attribute);

                final MessageResolver errorMessage = messageBuilder.build();
                context.addMessage(errorMessage);
            }
        }
    }
View Full Code Here


                messageBuilder.error();
                messageBuilder.source(basePath + "[" + attribute + "].value");
                messageBuilder.code("attributesForm.invalidSwapAttribute");
                messageBuilder.arg(attribute);

                final MessageResolver errorMessage = messageBuilder.build();
                context.addMessage(errorMessage);
            }
        }
    }
View Full Code Here

    if (StringUtils.hasText(message.getSummary())) {
      summaryText.append(message.getSummary());
    }

    String summarySource = source + SUMMARY_MESSAGE_KEY;
    MessageResolver summaryResolver;
    if (message.getSeverity() == FacesMessage.SEVERITY_INFO) {
      summaryResolver = new MessageBuilder().source(summarySource).defaultText(summaryText.toString()).info()
          .build();
    } else if (message.getSeverity() == FacesMessage.SEVERITY_WARN) {
      summaryResolver = new MessageBuilder().source(summarySource).defaultText(summaryText.toString()).warning()
          .build();
    } else if (message.getSeverity() == FacesMessage.SEVERITY_ERROR) {
      summaryResolver = new MessageBuilder().source(summarySource).defaultText(summaryText.toString()).error()
          .build();
    } else {
      summaryResolver = new MessageBuilder().source(summarySource).defaultText(summaryText.toString()).fatal()
          .build();
    }
    context.getMessageContext().addMessage(summaryResolver);

    StringBuffer detailText = new StringBuffer();
    if (StringUtils.hasText(message.getDetail())) {
      detailText.append(message.getDetail());
    }
    String detailSource = source + DETAIL_MESSAGE_KEY;
    MessageResolver detailResolver;
    if (message.getSeverity() == FacesMessage.SEVERITY_INFO) {
      detailResolver = new MessageBuilder().source(detailSource).defaultText(detailText.toString()).info()
          .build();
    } else if (message.getSeverity() == FacesMessage.SEVERITY_WARN) {
      detailResolver = new MessageBuilder().source(detailSource).defaultText(detailText.toString()).warning()
View Full Code Here

                messageBuilder.error();
                messageBuilder.source("attributes[" + attribute + "].value");
                messageBuilder.code("personLookup.invalidQueryAttribute");
                messageBuilder.arg(attribute);

                final MessageResolver errorMessage = messageBuilder.build();
                context.addMessage(errorMessage);
            }
        }
    }
View Full Code Here

                messageBuilder.error();
                messageBuilder.source(basePath + "[" + attribute + "].value");
                messageBuilder.code("x.is.not.a.valid.attribute");
                messageBuilder.arg(attribute);

                final MessageResolver errorMessage = messageBuilder.build();
                context.addMessage(errorMessage);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.springframework.binding.message.MessageResolver

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.