struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zoran Avtarovski <zo...@sparecreative.com>
Subject I18N Interceptor Change
Date Tue, 16 Aug 2016 10:06:51 GMT
HI Guys,

 

We have an old project which has been happily working for years. Recently we updated it to
2.5.x which was surprisingly easy.

 

One issue we did run into which was quite annoying was the I18N Interceptor now validates
locales against the list of default available locales in this bit of code:

 

if (locale != null && !Arrays.asList(Locale.getAvailableLocales()).contains(locale))
{

    locale = Locale.getDefault();

}

 

The problem is our app is for refugees and not all the languages in in the available locales
array. This must be relatively new as it worked in the old version 2.x ish.

 

As a work-around we over-rode the standard interceptor without the validation but I wanted
to ask if the sore team could use a parameter to bi-pass the validation.

 

For example a tag in the struts.xml file:

 

<interceptor-ref name="I18nInterceptor">

  <param name="validation">

     false

  </param>

</interceptor-ref>

 

and then access it in the interceptor.

 

Z.


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