Spring Security
  1. Spring Security
  2. SEC-1527

Internationalize one of the sample applications

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 3.1.0.M1
    • Component/s: Samples
    • Labels:
      None

      Description

      People get confused because Spring Security's filters don't automatically suppport i18n, even when it is working in Spring MVC. Adding support to one of the sample applications would provide a useful reference.

        Activity

        Hide
        Luke Taylor added a comment -

        I've added the message bundle to the app context to make the default security messages available and added a RequestContextFilter to web.xml to set the LocaleContextHolder. Tested with Chinese locale for login failure.

        Show
        Luke Taylor added a comment - I've added the message bundle to the app context to make the default security messages available and added a RequestContextFilter to web.xml to set the LocaleContextHolder. Tested with Chinese locale for login failure.
        Hide
        Nirwan added a comment -

        hello Luke,

        First of all thanks for creating the sample - it was helpful however such a spring beginner like me can't understand it easily. Could you please let me know how am i supposed to change the locale in your application - what is the responsible code? I tracked your change (compared versions of the sample before and after you created the example) what I found out is that you've created the new filter and are reading the locale somewhere on the website. The question is how to change it using the url... something like: http://someserver.com/bla/home?locale=en. The normal way (locale interceptors) dont work together with the spring security and the filter you added seems not to care at all about the URL change. Any tips?

        For details please look at: http://stackoverflow.com/questions/8478321/spring-security-i18n-how-to-make-it-work-together

        Thanks again for your great work!
        Best Regards,
        N.

        Show
        Nirwan added a comment - hello Luke, First of all thanks for creating the sample - it was helpful however such a spring beginner like me can't understand it easily. Could you please let me know how am i supposed to change the locale in your application - what is the responsible code? I tracked your change (compared versions of the sample before and after you created the example) what I found out is that you've created the new filter and are reading the locale somewhere on the website. The question is how to change it using the url... something like: http://someserver.com/bla/home?locale=en . The normal way (locale interceptors) dont work together with the spring security and the filter you added seems not to care at all about the URL change. Any tips? For details please look at: http://stackoverflow.com/questions/8478321/spring-security-i18n-how-to-make-it-work-together Thanks again for your great work! Best Regards, N.
        Hide
        Paul Babachanakh added a comment -

        Hello Luke,

        Very thanks for this interesting sample.
        But it would be very helpful to add to this sample how to implement internationalization and localization for Spring Security on login page.
        I mean that I want to have change locale on the login page and get error message on the login page accordingly to this locale.
        I trying to implement my own decision for this problem, but it always get messages in system locale.

        Thank you
        Pavel

        Show
        Paul Babachanakh added a comment - Hello Luke, Very thanks for this interesting sample. But it would be very helpful to add to this sample how to implement internationalization and localization for Spring Security on login page. I mean that I want to have change locale on the login page and get error message on the login page accordingly to this locale. I trying to implement my own decision for this problem, but it always get messages in system locale. Thank you Pavel

          People

          • Assignee:
            Luke Taylor
            Reporter:
            Luke Taylor
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: