[
https://issues.apache.org/struts/browse/WW-2511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jeromy Evans updated WW-2511:
-----------------------------
Component/s: Other
Description:
The i18n tag uses the following code to invoke the getTexts(bundleName) method
using a TextProvider in the ValueStack:
ResourceBundle bundle = (ResourceBundle) findValue("texts('" + name
+ "')");
This never works. It should read:
ResourceBundle bundle = (ResourceBundle) findValue("getTexts('" +
name + "')");
The code would have only occasionally caused problems as the tag calls
LocalizedTextUtil.findResourceBundle(name...) anyway when the line above failed.
For the record, I think calling methods by embedding non-typesafe expressions
in code is a bad idea.
was:
The i18n tag uses the following code to inoket the getTexts(bundleName) method
using a TextProvider in the ValueStack:
Priority: Minor (was: Major)
Bumped a key while writing original description. Description updated
> i18n tag never calls getTexts(bundleName) of TextProvider
> ---------------------------------------------------------
>
> Key: WW-2511
> URL: https://issues.apache.org/struts/browse/WW-2511
> Project: Struts 2
> Issue Type: Bug
> Components: Other
> Affects Versions: 2.0.11, 2.1.1
> Reporter: Jeromy Evans
> Priority: Minor
>
> The i18n tag uses the following code to invoke the getTexts(bundleName)
> method using a TextProvider in the ValueStack:
> ResourceBundle bundle = (ResourceBundle) findValue("texts('" +
> name + "')");
> This never works. It should read:
> ResourceBundle bundle = (ResourceBundle) findValue("getTexts('" +
> name + "')");
> The code would have only occasionally caused problems as the tag calls
> LocalizedTextUtil.findResourceBundle(name...) anyway when the line above
> failed.
> For the record, I think calling methods by embedding non-typesafe expressions
> in code is a bad idea.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.