Merge pull request #3529 from eugenp/internationalization-assets
remove enablemvc
This commit is contained in:
commit
70b81ca807
@ -6,14 +6,12 @@ import org.springframework.context.annotation.Bean;
|
|||||||
import org.springframework.context.annotation.ComponentScan;
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.web.servlet.LocaleResolver;
|
import org.springframework.web.servlet.LocaleResolver;
|
||||||
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.WebMvcConfigurerAdapter;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||||
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
|
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
|
||||||
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
|
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableWebMvc
|
|
||||||
@ComponentScan(basePackages = "com.baeldung.internationalization.config")
|
@ComponentScan(basePackages = "com.baeldung.internationalization.config")
|
||||||
public class MvcConfig extends WebMvcConfigurerAdapter {
|
public class MvcConfig extends WebMvcConfigurerAdapter {
|
||||||
|
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
$(document).ready(function() {
|
||||||
|
$("#locales").change(function () {
|
||||||
|
var selectedOption = $('#locales').val();
|
||||||
|
if (selectedOption != ''){
|
||||||
|
window.location.replace('international?lang=' + selectedOption);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
@ -4,16 +4,7 @@
|
|||||||
<meta charset="ISO-8859-1" />
|
<meta charset="ISO-8859-1" />
|
||||||
<title>Home</title>
|
<title>Home</title>
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script src="internationalization.js"></script>
|
||||||
$(document).ready(function() {
|
|
||||||
$("#locales").change(function () {
|
|
||||||
var selectedOption = $('#locales').val();
|
|
||||||
if (selectedOption != ''){
|
|
||||||
window.location.replace('international?lang=' + selectedOption);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1 th:text="#{greeting}"></h1>
|
<h1 th:text="#{greeting}"></h1>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user