BAEL-97 - minor fixes

This commit is contained in:
slavisa-baeldung 2017-01-05 13:05:51 +01:00
parent 0464c9f3bc
commit a9700891ef
2 changed files with 11 additions and 22 deletions

View File

@ -10,14 +10,6 @@ import org.springframework.web.servlet.view.InternalResourceViewResolver;
@Configuration @Configuration
public class BeanNameUrlHandlerMappingConfig { public class BeanNameUrlHandlerMappingConfig {
@Bean
public ViewResolver viewResolver() {
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
viewResolver.setPrefix("/");
viewResolver.setSuffix(".jsp");
return viewResolver;
}
@Bean @Bean
BeanNameUrlHandlerMapping beanNameUrlHandlerMapping() { BeanNameUrlHandlerMapping beanNameUrlHandlerMapping() {
return new BeanNameUrlHandlerMapping(); return new BeanNameUrlHandlerMapping();

View File

@ -23,12 +23,6 @@ public class HandlerMappingPrioritiesConfig {
return beanNameUrlHandlerMapping; return beanNameUrlHandlerMapping;
} }
@Bean("/welcome")
public BaeldungController welcomeBaeldungController() {
BaeldungController baeldungController = new BaeldungController();
return baeldungController;
}
@Bean @Bean
public SimpleUrlHandlerMapping simpleUrlHandlerMapping() { public SimpleUrlHandlerMapping simpleUrlHandlerMapping() {
SimpleUrlHandlerMapping simpleUrlHandlerMapping = new SimpleUrlHandlerMapping(); SimpleUrlHandlerMapping simpleUrlHandlerMapping = new SimpleUrlHandlerMapping();
@ -39,12 +33,6 @@ public class HandlerMappingPrioritiesConfig {
return simpleUrlHandlerMapping; return simpleUrlHandlerMapping;
} }
@Bean
public TestController test() {
TestController test = new TestController();
return test;
}
@Bean @Bean
public ControllerClassNameHandlerMapping controllerClassNameHandlerMapping() { public ControllerClassNameHandlerMapping controllerClassNameHandlerMapping() {
ControllerClassNameHandlerMapping bean = new ControllerClassNameHandlerMapping(); ControllerClassNameHandlerMapping bean = new ControllerClassNameHandlerMapping();
@ -52,9 +40,18 @@ public class HandlerMappingPrioritiesConfig {
return bean; return bean;
} }
@Bean("/welcome")
public BaeldungController welcomeBaeldungController() {
return new BaeldungController();
}
@Bean
public TestController test() {
return new TestController();
}
@Bean @Bean
public WelcomeController welcomeController() { public WelcomeController welcomeController() {
WelcomeController bean = new WelcomeController(); return new WelcomeController();
return bean;
} }
} }