[jboss-jira] [JBoss JIRA] Commented: (JBSEAM-340) Streamline use of i18n validation error messages

Valerij Timofeev (JIRA) jira-events at jboss.com
Mon Sep 4 06:25:43 EDT 2006


    [ http://jira.jboss.com/jira/browse/JBSEAM-340?page=comments#action_12342739 ] 
            
Valerij Timofeev commented on JBSEAM-340:
-----------------------------------------

A seam-gen generated scaffold application  relies only on the Seam properties files, for example :

@NotNull
@Length(min = 1, max = 50, message = "#{messages['err.fullname.length']}")
    public String getFullname()
    {
        return fullname;
    }

According entry in a properties file can look so:

err.fullname.length        = Fullname is mandatory and should be maximal 50 characters long

The problem is obvious: max length information is spread among two places :-(

The following form unfortunately doesn't work

err.fullname.length        = Fullname is mandatory and should be maximal {max} characters long

I suppose this could be a feature request: Seam messages must be able to interpret hibernate-validator alike variables {max}


> Streamline use of i18n validation error messages 
> -------------------------------------------------
>
>                 Key: JBSEAM-340
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-340
>             Project: JBoss Seam
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.1
>         Environment: Seam 1.0.1.GA
>            Reporter: Manfred Moser
>
> As described in the forum post referenced introducing i18n error message from validation of an entity bean does not have an example anywhere and actually only works nicely with a bit of a work around. The situation is that the hibernate validation needs the error message in ValidatorMessages_*.properties and Seam has its properties in messages_*.properties. For the entity bean to work without Seam (e.g. in a unit test that verifies the validation settings) the messages have to exist in the hibnerate resource bundle. For usage in Seam they have to exist in the Seam bundle. For a Seam app to actually start up all properties related to exist in the Hibnerate and the Seam bundles .. which leads to ugly duplication. A fix is to keep all properties in the seam bundles and copy them into the hibernate bundle at build time. The forum post has a ant task. It would however be better if Seam could somehow manage to pass the resources to hibernate or otherwise just automatically include the hibernate bundle. An example of the i18n of the validation message and other annotation based messages should be included in the examples.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       




More information about the jboss-jira mailing list