Spring MVC - ViewResolverRegistry Examples

Code Snippets Spring MVC 

Enabling content negotiation:

    @Override
public void configureViewResolvers(ViewResolverRegistry registry) {
registry.enableContentNegotiation(true);
registry.jsp()
.prefix("/WEB-INF/views/")
.suffix(".jsp");
}




    @Override
public void configureViewResolvers (ViewResolverRegistry registry) {
registry.groovy();
}
Original Post




    @Override
public void configureViewResolvers (ViewResolverRegistry registry) {
registry.freeMarker();
}
Original Post




    @Override
public void configureViewResolvers(ViewResolverRegistry registry) {
registry.beanName();
}
Original Post
    @Override
public void configureViewResolvers(ViewResolverRegistry registry) {
registry.tiles();
}
Original Post




    @Override
public void configureViewResolvers(ViewResolverRegistry registry) {
registry.jsp("/WEB-INF/views/", ".jsp");
}
Original Post




    @Override
public void configureViewResolvers(ViewResolverRegistry registry) {
registry.jsp();//default prefix=/WEB-INF/", suffix=".jsp"
}
Original Post




See Also