Skip to content

Commit

Permalink
minor cleanup work
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenp committed Feb 3, 2016
1 parent b5aef66 commit dffa1d2
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

@Component
public class UserWriterConverter implements Converter<User, DBObject> {

@Override
public DBObject convert(final User user) {
final DBObject dbObject = new BasicDBObject();
Expand All @@ -22,4 +23,5 @@ public DBObject convert(final User user) {
dbObject.removeField("_class");
return dbObject;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,42 @@
@ComponentScan("org.baeldung.web")
public class WebConfig extends WebMvcConfigurerAdapter {

public WebConfig() {
super();
}

@Override
public void addViewControllers(final ViewControllerRegistry registry) {

super.addViewControllers(registry);
registry.addViewController("/sample.html");
}

@Bean
public ViewResolver internalResourceViewResolver() {

final InternalResourceViewResolver bean = new InternalResourceViewResolver();
bean.setViewClass(JstlView.class);
bean.setPrefix("/WEB-INF/view/");
bean.setSuffix(".jsp");
bean.setOrder(2);
return bean;
}

@Bean
public ViewResolver xmlViewResolver() {

final XmlViewResolver bean = new XmlViewResolver();
bean.setLocation(new ClassPathResource("views.xml"));
bean.setOrder(1);
return bean;
}

@Bean
public ViewResolver resourceBundleViewResolver() {

final ResourceBundleViewResolver bean = new ResourceBundleViewResolver();
bean.setBasename("views");
bean.setOrder(0);
return bean;
}
public WebConfig() {
super();
}

//

@Override
public void addViewControllers(final ViewControllerRegistry registry) {
super.addViewControllers(registry);
registry.addViewController("/sample.html");
}

@Bean
public ViewResolver internalResourceViewResolver() {
final InternalResourceViewResolver bean = new InternalResourceViewResolver();
bean.setViewClass(JstlView.class);
bean.setPrefix("/WEB-INF/view/");
bean.setSuffix(".jsp");
bean.setOrder(2);
return bean;
}

@Bean
public ViewResolver xmlViewResolver() {
final XmlViewResolver bean = new XmlViewResolver();
bean.setLocation(new ClassPathResource("views.xml"));
bean.setOrder(1);
return bean;
}

@Bean
public ViewResolver resourceBundleViewResolver() {
final ResourceBundleViewResolver bean = new ResourceBundleViewResolver();
bean.setBasename("views");
bean.setOrder(0);
return bean;
}

}

0 comments on commit dffa1d2

Please sign in to comment.