File tree Expand file tree Collapse file tree 2 files changed +16
-14
lines changed
src/main/java/ru/mystamps/web/config Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 17
17
*/
18
18
package ru .mystamps .web .config ;
19
19
20
+ import org .springframework .context .MessageSource ;
21
+ import org .springframework .context .annotation .Bean ;
20
22
import org .springframework .context .annotation .Configuration ;
21
23
import org .springframework .context .annotation .Import ;
24
+ import org .springframework .context .support .ReloadableResourceBundleMessageSource ;
22
25
23
26
@ Configuration
24
27
@ Import ({
29
32
StrategiesConfig .class
30
33
})
31
34
public class ApplicationContext {
35
+
36
+ @ Bean (name = "messageSource" )
37
+ public MessageSource getMessageSource () {
38
+ ReloadableResourceBundleMessageSource messageSource =
39
+ new ReloadableResourceBundleMessageSource ();
40
+
41
+ messageSource .setBasename ("classpath:ru/mystamps/i18n/SpringSecurityMessages" );
42
+ messageSource .setDefaultEncoding ("UTF-8" );
43
+ messageSource .setFallbackToSystemLocale (false );
44
+
45
+ return messageSource ;
46
+ }
47
+
32
48
}
Original file line number Diff line number Diff line change 23
23
import org .springframework .context .annotation .Configuration ;
24
24
import org .springframework .context .annotation .ImportResource ;
25
25
import org .springframework .context .ApplicationListener ;
26
- import org .springframework .context .MessageSource ;
27
- import org .springframework .context .support .ReloadableResourceBundleMessageSource ;
28
26
29
27
import org .springframework .security .authentication .encoding .PasswordEncoder ;
30
28
import org .springframework .security .authentication .encoding .ShaPasswordEncoder ;
@@ -43,18 +41,6 @@ public class SecurityConfig {
43
41
@ Inject
44
42
private ServicesConfig servicesConfig ;
45
43
46
- @ Bean (name = "messageSource" )
47
- public MessageSource getMessageSource () {
48
- ReloadableResourceBundleMessageSource messageSource =
49
- new ReloadableResourceBundleMessageSource ();
50
-
51
- messageSource .setBasename ("classpath:ru/mystamps/i18n/SpringSecurityMessages" );
52
- messageSource .setDefaultEncoding ("UTF-8" );
53
- messageSource .setFallbackToSystemLocale (false );
54
-
55
- return messageSource ;
56
- }
57
-
58
44
@ Bean
59
45
public ApplicationListener <AuthenticationFailureBadCredentialsEvent > getApplicationListener () {
60
46
return new AuthenticationFailureListener ();
You can’t perform that action at this time.
0 commit comments