Can you please raise this in JIRA?
I think the key has always been evaluated but I'd have to check. I did
make some significant changes to this tag for 2.1.2 and may have
accidentally changed the behaviour.
I'd be very happy to turn off evaluation of the key as it wastes cycles
but would have to check the existing test cases to see if there was a
justification for it.
Pierre Thibaudeau wrote:
(I use Struts 2.1.2)
I am not sure if the following behaviour of <s:text> is documented.
(I have not read any comment about it.)
<s:text name="resource.bundle.key"/> will yield the message from the
resource bundle whose key is "resource.bundle.key", provided that key
exists. Otherwise, normally, you would get the name of the key
printed as is (at least in debug mode): "resource.bundle.key". So far
so good.
But what if:
a) the key does not exist AND
b) "resource.bundle.key" is a valid OGNL expression referring to an
object in the value stack?
According to the guides, the "name" parameter of <s:text> is not evaluated...
Yet that's not my experience... I find that, in the last scenario,
<s:text name="resource.bundle.key"/> has the same effect as
<s:property value="resource.bundle.key"/>. In other words, <s:text/>
ends up printing the String value of the object designated by the OGNL
expression %{resource.bundle.key}. A little disturbing...
Moreover, if I reduce the logging threshold of
com.opensymphony.xwork2.* (so as to see more messages), I will get
myriads of statements like the following one:
WARN OgnlValueStack:46 - Could not find property [resource]
... even when the message <s:text name="resource.bundle.key"/> ends up
printed exactly as it should be.
It seems as if the "name" parameter of the <s:text> is in fact
evaluated (unless I don't understand the meaning of that word...). Is
that behaviour desirable?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.138 / Virus Database: 270.5.4/1567 - Release Date: 22/07/2008 4:05 PM
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]