Results 1 to 2 of 2

Thread: MessageContext, MessageBuilder and nested properties

  1. #1

    Default MessageContext, MessageBuilder and nested properties

    Hi,

    I have a form in a web flow that is backed by a JavaBean with nested properties. I'm trying to add a validation message to one of the nested properties but it is not showing up.

    I'm using the following code to add the message:

    Code:
        MessageResolver messageResolvable 
                        = new MessageBuilder().error()
                                              .source("emailAddressFormBean.emailAddress")
                                              .code("userRegistration.emailAddress.not.unique")
                                              .build();
                requestContext.getMessageContext().addMessage(messageResolvable);
    Is it possible to specify messages for nested properties?

    The error message is making it to the form because it shows up inside a <form:errors path="*" /> tag, but not against the actual nested property in the form.

  2. #2

    Default

    Scratch that. Its working.

    I've just started using JRebel to dynamically load classes and I'm still getting used to what it will reload and what it will not. I was declaring my nested property path in a constant and JRebel doesn't seem to reload constants (fair enough). A clean build fixed the problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •