This content has been marked as final.
Show 6 replies
-
1. Re: Supporting multiple message bundle?
chrisrippe Jan 29, 2008 3:39 PM (in response to tonylmai)Here are a few ways. Each has their limitation.
In pages.xml you can specify a bundle for a page
page view-id="yourPage.xhtml" bundle="brokerage"
In the actual page you can
<f:loadBundle basename="brokerage" var="msg" /> -
2. Re: Supporting multiple message bundle?
tonylmai Jan 29, 2008 4:09 PM (in response to tonylmai)Still not working for me. :(
I have tried all of the followings:
In my pages.xml:<page view-id="/login.xhtml" bundle="brokerage" />
As well as in my login.xhtml<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
template="layout/td_logout_template.xhtml">
<f:loadBundle basename="brokerage" var="brokerage" />
What am I still doing wrong?
Thanks
-Tony -
3. Re: Supporting multiple message bundle?
msystems Jan 29, 2008 4:17 PM (in response to tonylmai)Why not:
<core:resource-loader> <core:bundle-names> <value>brokerage</value> <value>bundle2</value> <value>bundle3</value> </core:bundle-names> </core:resource-loader>
and you don't need (with above example)<f:loadBundle basename="brokerage" var="brokerage" />
now you can get a message by#{messages.text1}
-
4. Re: Supporting multiple message bundle?
tonylmai Jan 29, 2008 4:21 PM (in response to tonylmai)Uggg,
Sorry folks. I failed to modify the build.xml file to deploy the new bundle file. The whole time the message was right in front of me saying that it could not find the resource bundle. Should have taken it exactly the way it said. Duh.
Thanks
-Tony -
5. Re: Supporting multiple message bundle?
chrisrippe Jan 29, 2008 4:24 PM (in response to tonylmai)It may be the location or name of your resource bundle
In faces-config.xml you need to define your default local<application> ... <locale-config> <default-locale>en</default-locale> </locale-config> ... </application>
and in this scenerio you need to name your file
brokerage_en.properties
Then deploy it
somewhere like
\default\deploy\---.ear\---.war\WEB-INF\classes
if you have it under a directory under classes you need to reference you file with the full path like you would any other resource. -
6. Re: Supporting multiple message bundle?
tonylmai Jan 29, 2008 9:51 PM (in response to tonylmai)Thanks Chris.