[
https://issues.apache.org/struts/browse/WW-2539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43487#action_43487
]
Sami Dalouche commented on WW-2539:
-----------------------------------
Hmmm.... I cannot believe that it works for you.
I created a basic action, that does nothing, uses the default package and the
freeMarker view (@Results( { @Result(name = "success", value =
"/WEB-INF/views/home.ftl", type = FreemarkerResult.class) }))
I literally copy/pasted your code (just replaced the resource bundle name with
mine, and the key with mine). The code behaves the same under Struts 2.1.0 and
Struts 2.1.1 trunk (that I just checked out, along with xwork 2.1.1 snapshot)
<html>
<head>
</head>
<body>
<div>
testKey: <@s.text name="title"/>
<br/>
from test: <@s.i18n
name="funala.web.conversation.RequestResidence"><@s.text
name="location.label"/></@s.i18n>
<br/>
testKey: <@s.text name="title"/>
</div>
<hr />
<div>
testKey: <@s.text name="title"/>
<br/>
<@s.form action="sanity" theme="css_xhtml">
<@s.i18n name="funala.web.conversation.RequestResidence">
<@s.select
id="bla"
label="%{getText('location.label')}"
list="%{{'item 1', 'item 2'}}"
name="anyName" />
</@s.i18n>
</@s.form>
<br/>
testKey: <@s.text name="title"/>
</div>
</body>
</html>
=> the last testKey does not resolve the key
My Freemarker version is 2.3.11. Not sure about which other details are
relevant....
> @s.i18n kills the Action's I18n keys
> ------------------------------------
>
> Key: WW-2539
> URL: https://issues.apache.org/struts/browse/WW-2539
> Project: Struts 2
> Issue Type: Bug
> Affects Versions: 2.1.1
> Reporter: Sami Dalouche
>
> Let's say the current action's properties file (not the global
> messages.properties one) contains :
> MyAction.properties:
> myKey = "text"
> And the view of the actions contains :
> <@s.text name="myKey" /> <#-- This will work -->
> <@s.i18n name="my.package.MyMessages">
> <@s.text name="whatever.key" />
> </@s.i18n>
> <@s.text name="myKey" /> <#-- This won't work -->
> => What happens is that before @s.i18n pushes the properties, everything
> works as expected, but after the end of the tag,
> the action i18n keys are not resolvable anymore.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.