History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XW-478
Type: Bug Bug
Status: Closed Closed
Resolution: Not A Problem
Priority: Major Major
Assignee: Rainer Hermanns
Reporter: Miguel Monreal
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XWork

i18n interceptor malfunction

Created: 04/Oct/06 12:34 PM   Updated: 25/Mar/07 05:06 AM
Component/s: Interceptors
Affects Version/s: 1.2.1
Fix Version/s: 1.2.2

Environment: Windows XP SP2, webwork 2.2.4 ,Pentium IV


 Description  « Hide
I have found some stranges behaviours changing the request_locale dinamically :

BEHAVIOUR 1:

***JSP code:

<ww:url id="changeLanguageURLEspanol" action="test">
      <ww:param name="request_locale">es_ES</ww:param>
  </ww:url>
   
<ww:url id="changeLanguageURLPortugues" action="test">
      <ww:param name="request_locale">pt_PT</ww:param>
  </ww:url>
    
<ww:a href="%{changeLanguageURLEspanol}">Español</ww:a>
  <ww:a href="%{changeLanguageURLPortugues}">Portugues</ww:a>

***xwork.xml file:

<action name="test" class="samples.Test">
       <interceptor-ref name="i18n"/>
        <result name="success">result.jsp</result>
</action>

works fine (produces the change of the actual language and saves the request_locale in session ) but doesn't remove the request_locale parameter
from the url, in other word,s the consecutive requests looks like this:

http://localhost:8080/Samples/ActionName.action?request_locale=pt_PT
http://localhost:8080/Samples/AnotherActionName.action?request_locale=pt_PT
http://localhost:8080/Samples/AndAnotherActionName.action?request_locale=pt_PT

BEHAVIOUR 2:

I have test it with this other jsp code obtaining the same results (with the same xwork.xml configuration file):

<a href="test.action?request_locale=es_ES">Español</a>
<a href="test.action?request_locale=pt_PT">Portugues</a>

BEHAVIOUR 3:


*** JSP file:
 
<ww:url id="changeLanguageURLEspanol" action="test?request_locale=es_ES" />
  <ww:url id="changeLanguageURLPortugues" action="test?request_locale=pt_PT" />
  
<ww:a href="%{changeLanguageURLEspanol}">Español</ww:a>
  <ww:a href="%{changeLanguageURLPortugues}">Portugues</ww:a>

*** xwork.xml configuration file: Same

The result:

1.- if I click on Portugues:
http://localhost:8080/Samples/test.action?request_locale=pt_PT

It changes the language correctly

2.- then if I click on Español:
http://localhost:8080/Samples/test.action?request_locale=es_ES&request_locale=pt_PT

It doesnt change the language

3.- and if I click on Portugues again:
http://localhost:8080/Samples/test.action?request_locale=pt_PT&request_locale=pt_PT

It doesnt change the language

And so on

Finally, It was tested also with the completeStack

Thank you

 All   Comments   Change History      Sort Order:
Philip Luppens - [05/Oct/06 02:43 AM ]
Try using includeParams="none" in your ww:url tag.
Also, before submitting a bug report, please consult the user forum at http://forums.opensymphony.com/forum.jspa?forumID=1 to see if it's indeed a bug.

Miguel Monreal - [06/Oct/06 02:18 AM ]
I have tested the includeParams="none" in my url tag but that doesn't
 prevent the request_locale param from appearing in the successive
 requests like I reported yesterday in the behaviour 1:
 
http://localhost:8080/Samples/ActionName.action?request_locale=pt_PT
 http://localhost:8080/Samples/AnotherActionName.action?request_locale= pt_PT
 http://localhost:8080/Samples/AndAnotherActionName.action?request_loca> le=pt_ PT

We had developed some actions in webwork 2.2.2 and this behaviour
 doesn't happen, it appeared migrating to version 2.2.4
 
Apologise for reporting an issue without entering a new forum message.
 Because webwork has recently released version 2.2.4 and in the version
 2.2.2 it works fine I thought that there was a bug in the integration
 of the i18n interceptor

Tom Schneider - [06/Feb/07 11:00 PM ]
Moved from WW to XW since I18nInterceptor lives in xwork.

Rainer Hermanns - [25/Mar/07 05:06 AM ]
Added sample to webwork's showcase to show proper usage.
You need to set includeParams="none" for your URLs as mentioned above.

Commited as Rev 2876 in webwork's SVN repo.