mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-09 03:52:48 +00:00
Suppurt custom messages
According to the SpringSecurityMessageSource documentation class which uses SpringSecurityMessageSource should also implement MessageSourceAware interface in order to support alternative message source. Issue gh-4048
This commit is contained in:
parent
91c8cebf99
commit
422bc37115
@ -24,6 +24,8 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.context.ApplicationContextException;
|
||||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.MessageSourceAware;
|
||||
import org.springframework.context.support.MessageSourceAccessor;
|
||||
import org.springframework.jdbc.core.RowMapper;
|
||||
import org.springframework.jdbc.core.support.JdbcDaoSupport;
|
||||
@ -108,7 +110,7 @@ import org.springframework.util.Assert;
|
||||
* @author colin sampaleanu
|
||||
* @author Luke Taylor
|
||||
*/
|
||||
public class JdbcDaoImpl extends JdbcDaoSupport implements UserDetailsService {
|
||||
public class JdbcDaoImpl extends JdbcDaoSupport implements UserDetailsService, MessageSourceAware {
|
||||
// ~ Static fields/initializers
|
||||
// =====================================================================================
|
||||
|
||||
@ -393,4 +395,8 @@ public class JdbcDaoImpl extends JdbcDaoSupport implements UserDetailsService {
|
||||
public void setEnableGroups(boolean enableGroups) {
|
||||
this.enableGroups = enableGroups;
|
||||
}
|
||||
|
||||
public void setMessageSource(MessageSource messageSource) {
|
||||
this.messages = new MessageSourceAccessor(messageSource);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user