myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "daniel ccss" <danielcc...@gmail.com>
Subject Re: Messages from a resources.properties file
Date Thu, 26 Jul 2007 19:33:01 GMT
THANKS it did the work

On 7/26/07, Fabio Stracuzzi <fabiostracuzzi@gmail.com> wrote:
>
> Hi Daniel!
> You can do:
>
>
> FacesContext context = FacesContext.getCurrentInstance();
> Locale myRequestLocale = context.getExternalContext().getRequestLocale();
>
> ResourceBundle bundle = ResourceBundle.getBundle("
> com.daniel.resources.namefileresource", myRequestLocale);
> String message = bundle.getString("*InvalidUser*")
>
> FacesContext.getCurrentInstance().addMessage(null, new
> FacesMessage(message));
>
> Bye
> Fabio
>
>
> 2007/7/26, daniel ccss <danielccss2@gmail.com>:
> >
> > How can I do this:
> >
> >  FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("*Invalid
> > User*"));
> >
> > But reading the message from a resources.properties?:
> >
> > login.invalid.user= Invalid User
> >
>
>
>
> --
> Ciao ciao
> Fabio

Mime
View raw message