You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Sami Dalouche (JIRA)" <ji...@apache.org> on 2008/03/09 12:38:07 UTC

[jira] Created: (WW-2539) @s.i18n kills the Action's I18n keys

@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.


[jira] Commented: (WW-2539) @s.i18n kills the Action's I18n keys

Posted by "Sami Dalouche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43480#action_43480 ] 

Sami Dalouche commented on WW-2539:
-----------------------------------

BTW, 
trying @s.text name="whatever.key" after the end of the s.i18n key works. 
So, it looks like the resource bundle is not pop()'ed. 

> @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.


[jira] Commented: (WW-2539) @s.i18n kills the Action's I18n keys

Posted by "Sami Dalouche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43523#action_43523 ] 

Sami Dalouche commented on WW-2539:
-----------------------------------

Were you able to reproduce the problem with that ? do you need additional details ?

> @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.


[jira] Commented: (WW-2539) @s.i18n kills the Action's I18n keys

Posted by "Sami Dalouche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43485#action_43485 ] 

Sami Dalouche commented on WW-2539:
-----------------------------------

OK, so here is the simplest possible way to reproduce the problem :
<@s.i18n name="AnotherBundle">
<@s.select
				id="bla"
				theme="css_xhtml"
				label="toto"
				list="%{{'item 1', 'item 2'}}"
				name="anyName" />	
</...@s.i18n>

And the problem does not happen when select is not there. 
So.. Would it be possible that select (and potentially other tags) leave some garbage on the stack ?

> @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.


[jira] Issue Comment Edited: (WW-2539) @s.i18n kills the Action's I18n keys

Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43486#action_43486 ] 

newton_dave edited comment on WW-2539 at 3/9/08 2:17 PM:
---------------------------------------------------------

I still can't dupe this; here's the exact FTL I'm using:

{code:html}
<html>
  <body>
    testKey: <@s.text name="testKey"/>
    <br/>
    from test: <@s.i18n name="s2.i18n.TestMessages"><@s.text name="from.test"/></...@s.i18n>
    <br/>
    testKey: <@s.text name="testKey"/>
    </div>
    
    <hr/>
    
    <div>
      testKey: <@s.text name="testKey"/>
      <br/>
      <@s.form action="sanity" theme="css_xhtml">
        <@s.i18n name="s2.i18n.TestMessages">
        <@s.select
          id="bla"
          label="%{getText('from.test')}"
          list="%{{'item 1', 'item 2'}}"
          name="anyName" />	
        </...@s.i18n>
      </...@s.form>
      <br/>
      testKey: <@s.text name="testKey"/>
    </div>
  </body>
</html>
{code}

I also tried w/o the s.select getting the label via the getText call, just in case, but that didn't change anything.

I tried this both with S2.0.11 and the current trunk (which will be S2.1.1).

Could you try my FTL? I get the appropriate text for all the s.text tags and for the label for the s.select tag.

Thanks :)

      was (Author: newton_dave):
    I still can't dupe this; here's the exact FTL I'm using:

{code:lhtml}
<html>
  <body>
    testKey: <@s.text name="testKey"/>
    <br/>
    from test: <@s.i18n name="s2.i18n.TestMessages"><@s.text name="from.test"/></...@s.i18n>
    <br/>
    testKey: <@s.text name="testKey"/>
    </div>
    
    <hr/>
    
    <div>
      testKey: <@s.text name="testKey"/>
      <br/>
      <@s.form action="sanity" theme="css_xhtml">
        <@s.i18n name="s2.i18n.TestMessages">
        <@s.select
          id="bla"
          label="%{getText('from.test')}"
          list="%{{'item 1', 'item 2'}}"
          name="anyName" />	
        </...@s.i18n>
      </...@s.form>
      <br/>
      testKey: <@s.text name="testKey"/>
    </div>
  </body>
</html>
{code}

I also tried w/o the s.select getting the label via the getText call, just in case, but that didn't change anything.

I tried this both with S2.0.11 and the current trunk (which will be S2.1.1).

Could you try my FTL? I get the appropriate text for all the s.text tags and for the label for the s.select tag.

Thanks :)
  
> @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.


[jira] Commented: (WW-2539) @s.i18n kills the Action's I18n keys

Posted by "Sami Dalouche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43495#action_43495 ] 

Sami Dalouche commented on WW-2539:
-----------------------------------

Hmm...

OK, so I progressively removed everything in my app (All interceptors, reverted to the basic stack, removed ZeroConf, removed all my filters, cleaned up my spring context, etc.. until I found this code in a CustomFreemarkerManager :

protected void populateContext(ScopesHashModel model, ValueStack stack,
	    Object action, HttpServletRequest request,
	    HttpServletResponse response) {
	super.populateContext(model, stack, action, request, response);

	stack.set("lkjlkjkj", "lkjlkjlkj");
    }

and you can change the key and value by anything, it seems to screw up i18n... The rest of the app seems fine.

So, it seems that this simple stack.set() that makes i18n not pop() its value. Does it make any sense ??? 

> @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.


[jira] Resolved: (WW-2539) @s.i18n kills the Action's I18n keys

Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2539?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeromy Evans resolved WW-2539.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.1
         Assignee: Jeromy Evans

The closing I18n tag now throws an exception if it popped an unexpected object from the stack.

The opening tag creates a TextProvider and pushes it.  The closing tag must pop that same TextProvider otherwise:
 - the provider will continue to provide messages outside the tag; and/or
 - unexpected behaviour results as *something* was removed from the stack.

Stack manipulations within the i18n tag are permitted but the stack must be the same on the way in on the way out .

> @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
>            Assignee: Jeromy Evans
>             Fix For: 2.1.1
>
>
> 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.


[jira] Commented: (WW-2539) @s.i18n kills the Action's I18n keys

Posted by "Sami Dalouche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43483#action_43483 ] 

Sami Dalouche commented on WW-2539:
-----------------------------------

Hmm.. it looks like the problem is not that simplistic.

I have just tried to reproduce the problem using the struts 2 blank app, and the default Hello World action + JSP view, and couldn't actually reproduce it.

So then, I discovered that not all web pages on my application have this problem. 
As a result I am trying to find out the exact configuration that makes the i18n tag not to pop() its value;



> @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.


[jira] Issue Comment Edited: (WW-2539) @s.i18n kills the Action's I18n keys

Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43486#action_43486 ] 

newton_dave edited comment on WW-2539 at 3/9/08 2:17 PM:
---------------------------------------------------------

I still can't dupe this; here's the exact FTL I'm using:

{code:lhtml}
<html>
  <body>
    testKey: <@s.text name="testKey"/>
    <br/>
    from test: <@s.i18n name="s2.i18n.TestMessages"><@s.text name="from.test"/></...@s.i18n>
    <br/>
    testKey: <@s.text name="testKey"/>
    </div>
    
    <hr/>
    
    <div>
      testKey: <@s.text name="testKey"/>
      <br/>
      <@s.form action="sanity" theme="css_xhtml">
        <@s.i18n name="s2.i18n.TestMessages">
        <@s.select
          id="bla"
          label="%{getText('from.test')}"
          list="%{{'item 1', 'item 2'}}"
          name="anyName" />	
        </...@s.i18n>
      </...@s.form>
      <br/>
      testKey: <@s.text name="testKey"/>
    </div>
  </body>
</html>
{code}

I also tried w/o the s.select getting the label via the getText call, just in case, but that didn't change anything.

I tried this both with S2.0.11 and the current trunk (which will be S2.1.1).

Could you try my FTL? I get the appropriate text for all the s.text tags and for the label for the s.select tag.

Thanks :)

      was (Author: newton_dave):
    I still can't dupe this; here's the exact FTL I'm using:

{code:lang=html}
<html>
  <body>
    testKey: <@s.text name="testKey"/>
    <br/>
    from test: <@s.i18n name="s2.i18n.TestMessages"><@s.text name="from.test"/></...@s.i18n>
    <br/>
    testKey: <@s.text name="testKey"/>
    </div>
    
    <hr/>
    
    <div>
      testKey: <@s.text name="testKey"/>
      <br/>
      <@s.form action="sanity" theme="css_xhtml">
        <@s.i18n name="s2.i18n.TestMessages">
        <@s.select
          id="bla"
          label="%{getText('from.test')}"
          list="%{{'item 1', 'item 2'}}"
          name="anyName" />	
        </...@s.i18n>
      </...@s.form>
      <br/>
      testKey: <@s.text name="testKey"/>
    </div>
  </body>
</html>
{code}

I also tried w/o the s.select getting the label via the getText call, just in case, but that didn't change anything.

I tried this both with S2.0.11 and the current trunk (which will be S2.1.1).

Could you try my FTL? I get the appropriate text for all the s.text tags and for the label for the s.select tag.

Thanks :)
  
> @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.


[jira] Issue Comment Edited: (WW-2539) @s.i18n kills the Action's I18n keys

Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43486#action_43486 ] 

newton_dave edited comment on WW-2539 at 3/9/08 2:17 PM:
---------------------------------------------------------

I still can't dupe this; here's the exact FTL I'm using:

{code}
<html>
  <body>
    testKey: <@s.text name="testKey"/>
    <br/>
    from test: <@s.i18n name="s2.i18n.TestMessages"><@s.text name="from.test"/></...@s.i18n>
    <br/>
    testKey: <@s.text name="testKey"/>
    </div>
    
    <hr/>
    
    <div>
      testKey: <@s.text name="testKey"/>
      <br/>
      <@s.form action="sanity" theme="css_xhtml">
        <@s.i18n name="s2.i18n.TestMessages">
        <@s.select
          id="bla"
          label="%{getText('from.test')}"
          list="%{{'item 1', 'item 2'}}"
          name="anyName" />	
        </...@s.i18n>
      </...@s.form>
      <br/>
      testKey: <@s.text name="testKey"/>
    </div>
  </body>
</html>
{code}

I also tried w/o the s.select getting the label via the getText call, just in case, but that didn't change anything.

I tried this both with S2.0.11 and the current trunk (which will be S2.1.1).

Could you try my FTL? I get the appropriate text for all the s.text tags and for the label for the s.select tag.

Thanks :)

      was (Author: newton_dave):
    I still can't dupe this; here's the exact FTL I'm using:

{code:html}
<html>
  <body>
    testKey: <@s.text name="testKey"/>
    <br/>
    from test: <@s.i18n name="s2.i18n.TestMessages"><@s.text name="from.test"/></...@s.i18n>
    <br/>
    testKey: <@s.text name="testKey"/>
    </div>
    
    <hr/>
    
    <div>
      testKey: <@s.text name="testKey"/>
      <br/>
      <@s.form action="sanity" theme="css_xhtml">
        <@s.i18n name="s2.i18n.TestMessages">
        <@s.select
          id="bla"
          label="%{getText('from.test')}"
          list="%{{'item 1', 'item 2'}}"
          name="anyName" />	
        </...@s.i18n>
      </...@s.form>
      <br/>
      testKey: <@s.text name="testKey"/>
    </div>
  </body>
</html>
{code}

I also tried w/o the s.select getting the label via the getText call, just in case, but that didn't change anything.

I tried this both with S2.0.11 and the current trunk (which will be S2.1.1).

Could you try my FTL? I get the appropriate text for all the s.text tags and for the label for the s.select tag.

Thanks :)
  
> @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.


[jira] Commented: (WW-2539) @s.i18n kills the Action's I18n keys

Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43481#action_43481 ] 

Dave Newton commented on WW-2539:
---------------------------------

I can't dupe this (yet); can you check if you have the same problem under S2.0?

> @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.


[jira] Commented: (WW-2539) @s.i18n kills the Action's I18n keys

Posted by "Sami Dalouche (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43496#action_43496 ] 

Sami Dalouche commented on WW-2539:
-----------------------------------

(complete code of the CustomFreeMarkerManager that screws everything up :

public class CustomFreemarkerManager extends FreemarkerManager {

    @Override
    protected void populateContext(ScopesHashModel model, ValueStack stack,
	    Object action, HttpServletRequest request,
	    HttpServletResponse response) {
	super.populateContext(model, stack, action, request, response);

	stack.set("lkjlkjkj", "lkjlkjlkj");
	
	
    }

}


> @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.


[jira] Commented: (WW-2539) @s.i18n kills the Action's I18n keys

Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43484#action_43484 ] 

Dave Newton commented on WW-2539:
---------------------------------

*whew* I thought I was going mad.

One thing I'm wondering is if anything else is being pushed onto the stack within your s:i18n tag that might mess things up--all the end of the s:i18n tag does is "blind" pop; if something else was on the stack top I could see a potential problem.

Thanks for looking into this.

> @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.


[jira] Commented: (WW-2539) @s.i18n kills the Action's I18n keys

Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43489#action_43489 ] 

Dave Newton commented on WW-2539:
---------------------------------

It still works for me off of trunk using codebehind; I'm using the XWork used by S2 (and you should too).

> @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.


[jira] Commented: (WW-2539) @s.i18n kills the Action's I18n keys

Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43488#action_43488 ] 

Dave Newton commented on WW-2539:
---------------------------------

Post the rest of your configs then; you didn't say anything about using codebehind (if that's what you're using).

> @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.


[jira] Commented: (WW-2539) @s.i18n kills the Action's I18n keys

Posted by "Sami Dalouche (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (WW-2539) @s.i18n kills the Action's I18n keys

Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43486#action_43486 ] 

Dave Newton commented on WW-2539:
---------------------------------

I still can't dupe this; here's the exact FTL I'm using:

{code:lang=html}
<html>
  <body>
    testKey: <@s.text name="testKey"/>
    <br/>
    from test: <@s.i18n name="s2.i18n.TestMessages"><@s.text name="from.test"/></...@s.i18n>
    <br/>
    testKey: <@s.text name="testKey"/>
    </div>
    
    <hr/>
    
    <div>
      testKey: <@s.text name="testKey"/>
      <br/>
      <@s.form action="sanity" theme="css_xhtml">
        <@s.i18n name="s2.i18n.TestMessages">
        <@s.select
          id="bla"
          label="%{getText('from.test')}"
          list="%{{'item 1', 'item 2'}}"
          name="anyName" />	
        </...@s.i18n>
      </...@s.form>
      <br/>
      testKey: <@s.text name="testKey"/>
    </div>
  </body>
</html>
{code}

I also tried w/o the s.select getting the label via the getText call, just in case, but that didn't change anything.

I tried this both with S2.0.11 and the current trunk (which will be S2.1.1).

Could you try my FTL? I get the appropriate text for all the s.text tags and for the label for the s.select tag.

Thanks :)

> @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.