[jbossseam-issues] [JBoss JIRA] Updated: (JBSEAM-1254) facesmessages are not always fully interpolated

Pete Muir (JIRA) jira-events at lists.jboss.org
Fri Apr 27 19:05:30 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBSEAM-1254?page=all ]

Pete Muir updated JBSEAM-1254:
------------------------------

       Issue Type: Bug  (was: Feature Request)
    Fix Version/s: 1.3.0.BETA1
         Assignee: Pete Muir

Keith, could you submit this in diff format against CVS HEAD, I'm struggling to spot the changes you've made here.  Thanks!

> facesmessages are not always fully interpolated
> -----------------------------------------------
>
>                 Key: JBSEAM-1254
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1254
>             Project: JBoss Seam
>          Issue Type: Bug
>          Components: JSF
>    Affects Versions: 1.2.1.GA
>            Reporter: Keith Naas
>         Assigned To: Pete Muir
>            Priority: Minor
>             Fix For: 1.3.0.BETA1
>
>
> Whenever "FacesMessages.createFacesMessage(Severity severity, String messageTemplate, Object... params)" is called, the message is fully interpolated.  Meaning, it will resolve EL expressions inside of the message itself.  When "FacesMessages.createFacesMessage(Severity severity, String key, String defaultMessageTemplate, Object... params)", it does not do this full EL expression resolution.  The code changes below would probably support this.
>    private static String interpolateBundleMessage(String key, String defaultMessageTemplate, Object... params)
>    {
>       String messageTemplate = defaultMessageTemplate;
>       if ( key!=null )
>       {
>          java.util.ResourceBundle resourceBundle = ResourceBundle.instance();
>          if ( resourceBundle!=null ) 
>          {
>             try
>             {
>                String bundleMessage = resourceBundle.getString(key);
>                if (bundleMessage!=null) messageTemplate = bundleMessage;
>             }
>             catch (MissingResourceException mre) {} //swallow
>          }
>       }
>       return Interpolator.instance().interpolate(messageTemplate, params);
>    }
>    public static FacesMessage createFacesMessage(Severity severity, String key, String defaultMessageTemplate, Object... params)
>    {
>       String message = interpolateBundleMessage(key, defaultMessageTemplate, params);
>       if ( !Strings.isEmpty(message) )
>       {
>          return createFacesMessage( severity, message, null);
>       }
>       else
>       {
>          return null;
>       }
>    }

-- 
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 seam-issues mailing list