• <small id='doIn0'></small><noframes id='doIn0'>

      <bdo id='doIn0'></bdo><ul id='doIn0'></ul>
    <legend id='doIn0'><style id='doIn0'><dir id='doIn0'><q id='doIn0'></q></dir></style></legend>

      1. <tfoot id='doIn0'></tfoot>
        <i id='doIn0'><tr id='doIn0'><dt id='doIn0'><q id='doIn0'><span id='doIn0'><b id='doIn0'><form id='doIn0'><ins id='doIn0'></ins><ul id='doIn0'></ul><sub id='doIn0'></sub></form><legend id='doIn0'></legend><bdo id='doIn0'><pre id='doIn0'><center id='doIn0'></center></pre></bdo></b><th id='doIn0'></th></span></q></dt></tr></i><div id='doIn0'><tfoot id='doIn0'></tfoot><dl id='doIn0'><fieldset id='doIn0'></fieldset></dl></div>
      2. 如何在 Java 中从 DB 加载资源包消息?

        How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
        <i id='fxWqm'><tr id='fxWqm'><dt id='fxWqm'><q id='fxWqm'><span id='fxWqm'><b id='fxWqm'><form id='fxWqm'><ins id='fxWqm'></ins><ul id='fxWqm'></ul><sub id='fxWqm'></sub></form><legend id='fxWqm'></legend><bdo id='fxWqm'><pre id='fxWqm'><center id='fxWqm'></center></pre></bdo></b><th id='fxWqm'></th></span></q></dt></tr></i><div id='fxWqm'><tfoot id='fxWqm'></tfoot><dl id='fxWqm'><fieldset id='fxWqm'></fieldset></dl></div>

          <small id='fxWqm'></small><noframes id='fxWqm'>

            <tbody id='fxWqm'></tbody>
        1. <legend id='fxWqm'><style id='fxWqm'><dir id='fxWqm'><q id='fxWqm'></q></dir></style></legend>
              • <bdo id='fxWqm'></bdo><ul id='fxWqm'></ul>
                • <tfoot id='fxWqm'></tfoot>
                • 本文介绍了如何在 Java 中从 DB 加载资源包消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我可以动态加载资源包吗?我可以动态编辑资源包吗?

                  Can I load a resource bundle dynamically? Can I edit a resource bundle dynamically?

                  如果我能拥有这样一个逻辑资源包(即位于上下文中而不是物理文件),那将是最好的.

                  It would be best if I can have such a logical resource bundle (i.e. located in context not as physical file).

                  如何从文件加载资源包资源?

                  推荐答案

                  你能覆盖 ListResourceBundle?它提供了一个扩展点,用于添加您自己的 Object[][] 资源密钥对.

                  Would you be able to override the ListResourceBundle? It provides an extension point for adding in your own Object[][] of resource key pairs.

                  来自 javadoc:

                  From the javadoc:

                  public class MyResources extends ListResourceBundle {
                       protected Object[][] getContents() {
                           return new Object[][] = {
                           // LOCALIZE THIS
                               {"s1", "The disk "{1}" contains {0}."},  // MessageFormat pattern
                               {"s2", "1"},                               // location of {0} in pattern
                               {"s3", "My Disk"},                         // sample disk name
                               {"s4", "no files"},                        // first ChoiceFormat choice
                               {"s5", "one file"},                        // second ChoiceFormat choice
                               {"s6", "{0,number} files"},                // third ChoiceFormat choice
                               {"s7", "3 Mar 96"},                        // sample date
                               {"s8", new Dimension(1,5)}                 // real object, not just string
                           // END OF MATERIAL TO LOCALIZE
                           };
                       }
                   }
                  

                  此示例返回一个硬编码列表,但您可以修改它以从数据库或其他任何内容中返回您想要的任何内容.

                  This example returns a hard coded listing but you can modify that to return whatever you want from a database or anything else.

                  这篇关于如何在 Java 中从 DB 加载资源包消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)
                  How to find out locale-dependent text orientation in java?(如何在java中找出依赖于语言环境的文本方向?)
                  <tfoot id='NzJto'></tfoot>
                      <bdo id='NzJto'></bdo><ul id='NzJto'></ul>
                          <i id='NzJto'><tr id='NzJto'><dt id='NzJto'><q id='NzJto'><span id='NzJto'><b id='NzJto'><form id='NzJto'><ins id='NzJto'></ins><ul id='NzJto'></ul><sub id='NzJto'></sub></form><legend id='NzJto'></legend><bdo id='NzJto'><pre id='NzJto'><center id='NzJto'></center></pre></bdo></b><th id='NzJto'></th></span></q></dt></tr></i><div id='NzJto'><tfoot id='NzJto'></tfoot><dl id='NzJto'><fieldset id='NzJto'></fieldset></dl></div>
                            <tbody id='NzJto'></tbody>

                          <legend id='NzJto'><style id='NzJto'><dir id='NzJto'><q id='NzJto'></q></dir></style></legend>
                          • <small id='NzJto'></small><noframes id='NzJto'>