localeResolver() 이동

master
mjkhan21 7 months ago
parent 00e5432e93
commit 53e8138859

@ -2,7 +2,6 @@ package cokr.xit.foundation.boot;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -14,7 +13,6 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ReloadableResourceBundleMessageSource; import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.springframework.util.AntPathMatcher; import org.springframework.util.AntPathMatcher;
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
import com.fasterxml.jackson.core.JsonParser.Feature; import com.fasterxml.jackson.core.JsonParser.Feature;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
@ -44,16 +42,6 @@ public class CommonConfig {
return bean; return bean;
} }
/**SessionLocaleResolver .
* @return SessionLocaleResolver
*/
@Bean
public SessionLocaleResolver localeResolver() {
SessionLocaleResolver bean = new SessionLocaleResolver();
bean.setDefaultLocale(Locale.getDefault());
return bean;
}
/**LeaveaTrace . /**LeaveaTrace .
* @return LeaveaTrace * @return LeaveaTrace
*/ */

@ -1,5 +1,7 @@
package cokr.xit.foundation.boot; package cokr.xit.foundation.boot;
import java.util.Locale;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -11,6 +13,7 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
import org.springframework.web.servlet.view.BeanNameViewResolver; import org.springframework.web.servlet.view.BeanNameViewResolver;
import org.springframework.web.servlet.view.JstlView; import org.springframework.web.servlet.view.JstlView;
@ -67,6 +70,16 @@ public class MvcConfig implements WebMvcConfigurer {
registry.addInterceptor(accessInitializer()).addPathPatterns(URL_PATTERNS); registry.addInterceptor(accessInitializer()).addPathPatterns(URL_PATTERNS);
} }
/**SessionLocaleResolver .
* @return SessionLocaleResolver
*/
@Bean
public SessionLocaleResolver localeResolver() {
SessionLocaleResolver bean = new SessionLocaleResolver();
bean.setDefaultLocale(Locale.getDefault());
return bean;
}
/**BeanNameViewResolver . /**BeanNameViewResolver .
* @return BeanNameViewResolver * @return BeanNameViewResolver
*/ */

Loading…
Cancel
Save