Details
-
Type: New Feature
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Component/s: ICE-Components
-
Labels:None
-
Environment:All
-
Affects:Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial
Description
Need a custom loadBundle that will prevent the bundle from caching and allow messages bundle to dynamically change when the locale is changed
-
Hide
- ICE-2763.war
- 6.09 MB
- Adnan Durrani
-
- META-INF/MANIFEST.MF 0.1 kB
- WEB-INF/classes/.../NavigationBean.class 1 kB
- WEB-INF/classes/.../entity/Employee.class 2 kB
- WEB-INF/classes/org/.../entity/Person.class 1 kB
- WEB-INF/classes/.../EmployeeService.class 0.3 kB
- WEB-INF/.../EmployeeServiceImpl$1.class 0.3 kB
- WEB-INF/.../EmployeeServiceImpl$EmployeeComparator.class 3 kB
- WEB-INF/.../EmployeeServiceImpl.class 6 kB
- WEB-INF/classes/.../ContextUtilBean.class 3 kB
- WEB-INF/classes/.../util/FacesUtils.class 4 kB
- WEB-INF/.../MessageBundleLoader.class 1 kB
- WEB-INF/.../RandomNumberGenerator.class 2 kB
- WEB-INF/.../SourceCodeLoaderServlet.class 3 kB
- WEB-INF/.../StyleBean$StylePath.class 1 kB
- WEB-INF/classes/org/.../util/StyleBean.class 3 kB
- WEB-INF/classes/org/.../bean/BaseBean.class 1 kB
- WEB-INF/classes/org/.../bean/BeanNames.class 0.7 kB
- WEB-INF/classes/.../NavigationNames.class 0.4 kB
- WEB-INF/classes/.../Inventory.class 2 kB
- WEB-INF/classes/.../InventoryInterface.class 0.5 kB
- WEB-INF/classes/.../InventoryItem.class 2 kB
- WEB-INF/.../ButtonsAndLinksBean.class 2 kB
- WEB-INF/classes/.../GroupingModel.class 0.8 kB
- WEB-INF/.../ColumnsBean$CellKey.class 1 kB
- WEB-INF/classes/.../ColumnsBean.class 5 kB
- WEB-INF/classes/.../SortHeaderModel.class 3 kB
- WEB-INF/.../DataScrollingModel$DataScrollMode.class 2 kB
- WEB-INF/classes/.../DataScrollingModel.class 3 kB
- WEB-INF/classes/.../DataTableBase.class 1 kB
- WEB-INF/.../ResizeableColumnModel.class 0.8 kB
Issue Links
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
An ice:loadBundle component would also simplify the Bridge since bundles would not need to be propagated in the requestMap.
To use use ICE-Faces in an WEB-Application with international accounts/Users, it is a "MUST" to
to solve this problem.
It should compatible to use with actual MessageBundleLoader to avoid to change the current code.
Using f:loadBundle or ice:loadBundle is completely not necessary!
For good performance use features of jsf.1.2
<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
(...)
<application>
(...)
<resource-bundle>
<base-name>...messages</base-name>
<var>msg1</var>
</resource-bundle>
<resource-bundle>
<base-name>...messages2</base-name>
<var>msg2</var>
</resource-bundle>
(...)
<application>
(...)
@Krashan: it is necessary! For example we have an application where we dynamically change theme and language. We need to dynamically change the message bundles. Which seems not to be possible the way you described.
I also use the resource bundle as explained by Krashan. That really, really works. I remember the user's locale in a bean and specify it to the view root in <f:view locale="#
{bean.locale}" ... >. Just let the user alter the locale property in the bean by clicking a flag or so and on the next page reload you see the new language. No problem. No need to fuzz around with the message bundles. All taken care of by JSF. Or is this not what you want?
ice:loadBundle added to the trunk:
Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\conf\META-INF\faces-config.xml
Adding: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\loadbundle
Adding: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\loadbundle\LoadBundle.java
Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\utils\MessageUtils.java
Adding: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\custom\loadbundle-component.xml
Adding: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\custom\loadbundle-renderer.xml
Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\extended-faces-config.xml
Adding: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-loadbundle-props.xml
Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\custom\loadbundle-renderer.xml
Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\loadbundle\LoadBundle.java
Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\utils\MessageUtils.java
Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-loadbundle-props.xml
Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\conf\META-INF\faces-config.xml
Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\extended-faces-config.xml
Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\custom\loadbundle-component.xml
Completed: At revision: 17868
@Paul and Krashan: You're right. For my purposes I can really use standard JSF means. I've just given it a try. Sorry for my doubts.
locale changes respected. revision 17870
TLDDocs added: revision 17874
Locale with <resource-bundle> works well.
I think that this new feature will start a new set of problems for not advanced users.
The new ice:loadBundle component added to the trunk. Its provides two dynamic features:
1- the message bundle base can be changed dynamically. (So you can change entire messages bundle)
2- if the "locale" has changed on ViewRoot dynamically, it reloads the bundle for the corresponding locale.
Feature "1" is working fine, but feature "2" is not working due to the fact that we use the same ViewRoot on each request for the same page and in the D2DViewHandler there is a call "setLocale" on viewRoot which cache the locale into the viewRoot, so the getViewRoot always returns the cached locale and doesn't respect the value binding. This is captured in ICE-3755.
demo added
Not working with JSF 1.1
support added for JSF 1.1
trunk revision 17918
Yes, I think it shows the need for an ice:loadBundle component, which will detect Locale changes, and uncache old ResourceBundles appropriately.