Formatted code

This commit is contained in:
Tarun Jain 2020-09-15 20:32:07 +05:30
parent 4526309cf2
commit 51c2e22324
2 changed files with 19 additions and 19 deletions

View File

@ -9,19 +9,19 @@ import org.springframework.web.filter.CharacterEncodingFilter;
@SpringBootApplication @SpringBootApplication
public class CharacterEncodingDemo { public class CharacterEncodingDemo {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(CharacterEncodingDemo.class, args); SpringApplication.run(CharacterEncodingDemo.class, args);
} }
@Bean @Bean
public FilterRegistrationBean filterRegistrationBean() { public FilterRegistrationBean filterRegistrationBean() {
CharacterEncodingFilter filter = new CharacterEncodingFilter(); CharacterEncodingFilter filter = new CharacterEncodingFilter();
filter.setEncoding("UTF-8"); filter.setEncoding("UTF-8");
filter.setForceEncoding(true); filter.setForceEncoding(true);
FilterRegistrationBean registrationBean = new FilterRegistrationBean(); FilterRegistrationBean registrationBean = new FilterRegistrationBean();
registrationBean.setFilter(filter); registrationBean.setFilter(filter);
registrationBean.addUrlPatterns("/*"); registrationBean.addUrlPatterns("/*");
return registrationBean; return registrationBean;
} }
} }

View File

@ -5,9 +5,9 @@ import org.springframework.web.bind.annotation.GetMapping;
@Controller @Controller
public class CharEncodingCheckController { public class CharEncodingCheckController {
@GetMapping("/ping") @GetMapping("/ping")
public String ping() { public String ping() {
return "path"; return "path";
} }
} }