myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
Subject configure language bundle as managed bean (was: Sandbox behaviour!!)
Date Wed, 16 May 2007 12:39:08 GMT
Hi!

I meant you create a managed bean entry, something like:

        <managed-bean>
                <managed-bean-name>bundle</managed-bean-name>
               
<managed-bean-class>your.package.name.LanguageBundler</managed-bean-class>
                <managed-bean-scope>application</managed-bean-scope>
        </managed-bean>

where LanguageBundler is a class implementing the Map interface and the
methods
containsKey and get - the rest can throw an UnsupportedOperationException
In get() read from your ResourceBundle.

That way you are close to JSF 1.2 and the problems outlined previously
are gone.

Hope this helps!

Ciao,
Mario
> Hi evrybody,
>  
> I have configured it:
>  
>    
>
> <application>
>
> <view-handler>
>
> org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl
>
> </view-handler>
>
> <locale-config>
>
> <default-locale>es</default-locale>
>
> </locale-config>
>
> <message-bundle>
>
> servidesk.messages.MessageResources
>
> </message-bundle>
>
> </application>
>
>  
>
> But still necesary to put:
>
>  
>
>
>
> ----- Mensaje original ----
> De: Adam Winer <awiner@gmail.com>
> Para: MyFaces Discussion <users@myfaces.apache.org>
> Enviado: miércoles, 16 de mayo, 2007 9:06:14
> Asunto: Re: Sandbox behaviour!!
>
> Yes, in JSF 1.2 you can add a <resource-bundle> tag to
> faces-config.xml, which will add a ResourceBundle as
> if it were a managed bean available on all pages.  This
> is more efficient than f:loadBundle, and also makes the
> resource bundle available at all parts of the JSF lifecycle
> (instead of just during Render Response).
>
> -- Adam Winer
>
>
> On 5/15/07, Mario Ivankovits <mario@ops.co.at> wrote:
> > Hi!
> > > try using s:loadBundle instead of f:loadBundle for your messages
> > If there is only one bundle for your application I'd suggest to
> > configure it as managed bean (implementing the map interface).
> >
> > That way you
> > * can get rid of configuring it on each page
> > * have it available even for ajax requests
> > * it is JSF 1.2 like (as far as I know you can configure it there with a
> > special managed-bean entry)
> >
> > Ciao,
> > Mario
> > >
> > > regards
> > >
> > > Ernst
> > >
> > > On 5/15/07, Angel Miralles Arevalo <anmiralles@yahoo.es> wrote:
> > >>
> > >> Hi everybody,
> > >>
> > >> can anybody explain me, what are functionalities for sandbox
> > >> components? For
> > >> example if you put a message from a ".properties" inside a
> > >> <s:pprPanelGroup></s:pprPanelGroup>. When you execute the
> > >> component (ajax) the message has disappeared!
> > >>
> > >> Thank you very much!!
> > >>
> > >>  ________________________________
> > >>
> > >> LLama Gratis a cualquier PC del Mundo.
> > >> Llamadas a fijos y móviles desde 1 céntimo por minuto.
> > >> http://es.voice.yahoo.com <http://es.voice.yahoo.com/>
> > >
> >
> >
>
>
> ------------------------------------------------------------------------
>
> ¡Descubre una nueva forma de obtener respuestas a tus preguntas!
> Entra en Yahoo! Respuestas
> <http://es.answers.yahoo.com/;_ylc=X3oDMTEzNWwxbTZtBF9TAzIxMTQ3MTQxOTAEc2VjA01haWwEc2xrA3RhZ2xpbmVz>.


Mime
View raw message