struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alireza Fattahi <afatt...@yahoo.com>
Subject s:if and locale
Date Sun, 08 Sep 2013 11:10:07 GMT
HI,
 
I have used the strtuts I18n feature for managing the localization.  The site works fine
and the messages are selected from correct resource bundels.
 
I have this problem....
 
I want to change css base on the user locale.
So I use below code in jsp:
**************************
The locale is = ${locale}  //Here the correct locale is displayed!
<s:if test="%{locale == 'en_US'}"> //This condition is always false
     <link href="site-en.css" rel="stylesheet" type="text/css" />
</s:if>
<s:else>
   <link href="site-other.css" rel="stylesheet" type="text/css" />
</s:else>
**************************

No matter what the locale value is, always the else condition is triggered !!
The jsp out puts 
**************
The locale is=en_US
   <link href="site-other.css" rel="stylesheet" type="text/css" />
**********


When I see the Struts ValueStack with <s:debug/> the locale value is correct and is
what it has too.

Is there any thing wrong with my test conditin please help!

~Regards,
~~Alireza Fattahi
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message