title: How to set locale in a custom Struts 2 ActionMapper
body: <p>I have implemented a custom ActionMapper which obtains the locale from the URI (the URI itself, not the request parameters). From within ActionMapper.getMapping(), how do I set the locale for the current action?</p>
  
  <p>Here are some ideas I've considered:</p>
  
  <ul>
  <li>ActionContext.getCurrent().setLocale(). Unfortunately, it seems that a fresh new ActionContext is created when the action is invoked, and the locale is reset to the default.</li>
  <li>Set the parameter request_locale, which will be processed by the i18n interceptor. Unfortunately, the i18n interceptor insists on setting the locale for not just the current action but the current session too, which throws an exception because sessions are not enabled for my application.</li>
  <li>Set a parameter and process it in the action itself, by implementing setLocale(). Straightforward, but it means that none of the interceptors will have access to the locale.</li>
  <li>Set a parameter and write an interceptor (to basically do the same thing as the i18n interceptor without assuming session support). Seems like overkill for such a simple issue, not to mention re-inventing the wheel.</li>
  </ul>
  
  <p>Is there any simple way of achieving this?</p>