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…
Reference in New Issue