Results 1 to 4 of 4

Thread: acegi locale

  1. #1
    Join Date
    Apr 2007
    Location
    Montreal, Canada
    Posts
    31

    Default acegi locale

    In my applicationContext.xml, I defined
    <bean id="messageSource"
    class="org.springframework.context.support.Resourc eBundleMessageSource">
    <property name="basename">
    <value>messages</value>
    </property>
    </bean>

    then, I defined AbstractUserDetailsAuthenticationProvider.locked=U ser account is locked(test) in messages.properties and AbstractUserDetailsAuthenticationProvider.locked=用 户被锁定 in messages_zh_CN.properties

    In my UserDetailsService implementation, isAccountNonLocked() function will return false. So in my login jsp,
    <%= ((AuthenticationException) session.getAttribute(AbstractProcessingFilter.ACEG I_SECURITY_LAST_EXCEPTION_KEY)).getMessage() %>
    will print out "User account is locked(test)". It seems I could use my properties replace default message. But When I change my firefox default language into zh-CN, it still returned English message.
    So I think acegi does not use spring MVC, when I sumbit form to j_acegi_security_check, acegi could not use default spring AcceptHeaderLocaleResolver to set Locale. It will always get tomcat default-locale.

    Could you give me some suggestion? How could I make j_acegi_security_check to support Locale?

    Thanks a lot.
    Arden
    In spring,

  2. #2
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    Do a search for locale on the acegi forum, there are lots of answers to might help.

  3. #3
    Join Date
    Apr 2007
    Location
    Montreal, Canada
    Posts
    31

    Default

    Thanks for your reply. I found the following topic, which could solve my problem.
    http://forum.springframework.org/showthread.php?t=22263

  4. #4
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    Glad you found a helpful solution. There have been lots of posts on the forum, it's always a good idea to do a search.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •