Formatted code
This commit is contained in:
parent
4526309cf2
commit
51c2e22324
|
@ -9,19 +9,19 @@ import org.springframework.web.filter.CharacterEncodingFilter;
|
|||
@SpringBootApplication
|
||||
public class CharacterEncodingDemo {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(CharacterEncodingDemo.class, args);
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(CharacterEncodingDemo.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FilterRegistrationBean filterRegistrationBean() {
|
||||
CharacterEncodingFilter filter = new CharacterEncodingFilter();
|
||||
filter.setEncoding("UTF-8");
|
||||
filter.setForceEncoding(true);
|
||||
|
||||
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
|
||||
registrationBean.setFilter(filter);
|
||||
registrationBean.addUrlPatterns("/*");
|
||||
return registrationBean;
|
||||
}
|
||||
@Bean
|
||||
public FilterRegistrationBean filterRegistrationBean() {
|
||||
CharacterEncodingFilter filter = new CharacterEncodingFilter();
|
||||
filter.setEncoding("UTF-8");
|
||||
filter.setForceEncoding(true);
|
||||
|
||||
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
|
||||
registrationBean.setFilter(filter);
|
||||
registrationBean.addUrlPatterns("/*");
|
||||
return registrationBean;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,9 +5,9 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||
|
||||
@Controller
|
||||
public class CharEncodingCheckController {
|
||||
|
||||
@GetMapping("/ping")
|
||||
public String ping() {
|
||||
return "path";
|
||||
}
|
||||
|
||||
@GetMapping("/ping")
|
||||
public String ping() {
|
||||
return "path";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue