Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4943

opensymphony.xwork2.util.LocalizedTextUtil can't get i18n resources

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Cannot Reproduce
    • 2.3.34
    • 6.0.0
    • Integration
    • None

    Description

      This problem is caused by the cache mechanism of i18 resources. In findDefaultText() method, it used the ClassLoader  hashcode as the key. But it forget the child-parent hierarchy. In some framework, they will create new ClassLoader as the WebappClassLoader children. In such case,it's impossible to find the i18 resources for them.

      Source code in LocalizedTextUtil.findDefaultText:

      List<String> localList = classLoaderMap.get(Thread.currentThread().getContextClassLoader().hashCode());

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              linus_yan Linus Yan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: