-
Apr 18th, 2007, 09:57 PM
#1
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,
-
Apr 19th, 2007, 06:53 AM
#2
Do a search for locale on the acegi forum, there are lots of answers to might help.
-
Apr 19th, 2007, 01:38 PM
#3
Thanks for your reply. I found the following topic, which could solve my problem.
http://forum.springframework.org/showthread.php?t=22263
-
Apr 19th, 2007, 01:47 PM
#4
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
-
Forum Rules