[jbossseam-issues] [JBoss JIRA] Resolved: (JBSEAM-4056) "value required" message for missing page param should give name of missing parameter

Dan Allen (JIRA) jira-events at lists.jboss.org
Thu Apr 9 02:03:22 EDT 2009


     [ https://jira.jboss.org/jira/browse/JBSEAM-4056?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Allen resolved JBSEAM-4056.
-------------------------------

    Fix Version/s: 2.1.2.GA
       Resolution: Done
         Assignee: Dan Allen


I have resolved this issue the official JSF way. I use the "get message from resource bundle or default approach" and pass in the parameter name as an argument that can be used in the message template. There are actually two keys:

Scenario #1: parameter required
Key: org.jboss.seam.param.Required
Default: '{0}' parameter is required
0 = name of parameter

Scenario #2: parameter invalid
Key: org.jboss.seam.param.Invalid
Default: '{1}' parameter is invalid: {0}
0 = validation message or exception message
1 = name of parameter

I know it seems strange to make {1} the placeholder for the name of the parameter in the second scenario, but that is consistent with all other validators in JSF. The label is always the last positional parameter.

> "value required" message for missing page param should give name of missing parameter
> -------------------------------------------------------------------------------------
>
>                 Key: JBSEAM-4056
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-4056
>             Project: Seam
>          Issue Type: Patch
>          Components: Core
>    Affects Versions: 2.1.1.GA
>         Environment: Kubuntu 8, jboss-seam-2.1.1.GA/
>            Reporter: Ian Darwin
>            Assignee: Dan Allen
>             Fix For: 2.1.2.GA
>
>         Attachments: to.seam
>
>
> When you somehow submit a post with a missing page param, the stack trace only says:
> javax.faces.validator.ValidatorException: value is required
>         at org.jboss.seam.navigation.Param.addRequiredMessage(Param.java:272)
>         at org.jboss.seam.navigation.Param.getStringValueFromRequest(Param.java:175)
>         ... 
> The attached patch changes the message to
> javax.faces.validator.ValidatorException: value is required pKey
> making it much easier to diagnose the problem.

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

        



More information about the seam-issues mailing list