Announcement Announcement Module
Collapse
No announcement yet.
In 1.1.0.M2, label key separator changed from "." to "_". Why? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • In 1.1.0.M2, label key separator changed from "." to "_". Why?

    All rb key separators were changed from "." to "_" (underscore) in Roo 1.1.0.M2.
    Is this a bug or a feature?

    The JSR 303 validators use <Validator>.<Object>.<Field>
    e.g. "Pattern.user.name"
    Was this changed in Spring so it also uses "_", or do we have to use a mixture of "_" and "." rb keys depending on what components use it?

  • #2
    This change has been explained in the Roo Jira https://jira.springsource.org/browse/ROO-1001. It boils down to very few choices for creating appropriate keys which don't clash with CSS, JS frameworks or XHTML restrictions. Underscores was the only option left here.

    Hibernate validator messages are currently separate from the Roo provided i18n support due to the rather ridged requirements by JSR 303. However, I believe the release of Spring 3.0.4 will contain some support for integrating them with Roo's message bundles.

    Hope this explains things

    -Stefan

    Comment


    • #3
      Originally posted by Stefan Schmidt View Post
      Hibernate validator messages are currently separate from the Roo provided i18n support due to the rather ridged requirements by JSR 303. However, I believe the release of Spring 3.0.4 will contain some support for integrating them with Roo's message bundles.
      What exactly do you mean by this? I think I don't got it.
      Since 1.1.0.M1 I already have the JSR 303 validator error messages within the Roo provided message bundles and it just works out of the box. With the current implementation, we need to use a mixture of "_" and "." rb keys, which is very ugly.

      Comment


      • #4
        Hi,

        I was referring to this Spring framework Jira ticket: http://jira.springframework.org/browse/SPR-7307

        If you had both working before that is nice, I had not tested it.

        I do agree that using underscores as delimiters is somewhat unusual if not ugly, but as explained in the ticket, we have no other choice really.

        -Stefan

        Comment


        • #5
          Wouldn't it be possible to not use the id as rb key directly in the tags, but to build the keys by converting "_" to "." before spring:message usage?

          Comment


          • #6
            Yes that would probably work, but we wanted to avoid the resulting (somewhat unnecessary) use of jstl replace function everytime a tag is used. So the real question is 'nicer message bundles vs avoiding extra string manipulation .

            -Stefan

            Comment

            Working...
            X