Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2282

Override default locale per application

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.2.4
    • Fix Version/s: 1.4.x
    • Component/s: Core
    • Labels:
    • Environment:
      Operating System: Linux
      Platform: PC
    • Bugzilla Id:


      As far as I understand it - the struts framework will set the locale in the
      users session to Locale.getDefault() when

      1) The session value for locale is not already set
      2) The users browser has not sent an Accept-Language header

      So - to set a default locale for an application you need to set the default
      locale for the application's JVM.

      Under JBoss (maybe others) - one JVM is shared across applications. This means
      that it is not possible to handle the situation where one struts app needs lang1
      as default and one struts app needs lang2 as default.

      Concrete example

      App1 has the following property files (and should default to english)

      app1.properties (in english)
      app1_no.properties (norwegian)
      app1_da.properties (danish)

      App2 has the following property files (and should default to norwegian)

      app2.properties (in norwegian)
      app2_en.properties (english)

      System locale is english.

      This means that app2 actually defaults to english since system locale is in
      english and app2 has an english properties file.

      It would be nice to be able to set at struts-config.xml level (perhaps
      controller section) an


      so that you can override the default locale on a per application basis.

      Note - all other locale based stuff is working well - this is just talking about
      the initialisation of the session locale based on default locale.


        Issue Links



            • Assignee:
              chris@empolis.no Chris Searle


              • Created:

                Issue deployment