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:
vitalii-dmytruk 2016-08-30 15:50:21 +03:00 committed by Rob Winch
parent 91c8cebf99
commit 422bc37115
1 changed files with 7 additions and 1 deletions

View File

@ -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);
}
}