Moved ViewResolver article related code from spring-mvc-java to spring-mvc-basics
This commit is contained in:
@@ -9,7 +9,6 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
|
||||
- [Spring Bean Annotations](http://www.baeldung.com/spring-bean-annotations)
|
||||
- [Introduction to Pointcut Expressions in Spring](http://www.baeldung.com/spring-aop-pointcut-tutorial)
|
||||
- [Introduction to Advice Types in Spring](http://www.baeldung.com/spring-aop-advice-tutorial)
|
||||
- [A Guide to the ViewResolver in Spring MVC](http://www.baeldung.com/spring-mvc-view-resolver-tutorial)
|
||||
- [Integration Testing in Spring](http://www.baeldung.com/integration-testing-in-spring)
|
||||
- [A Quick Guide to Spring MVC Matrix Variables](http://www.baeldung.com/spring-mvc-matrix-variables)
|
||||
- [Intro to WebSockets with Spring](http://www.baeldung.com/websockets-spring)
|
||||
|
||||
@@ -12,7 +12,6 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Description;
|
||||
import org.springframework.context.support.ResourceBundleMessageSource;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.ByteArrayHttpMessageConverter;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
@@ -26,8 +25,6 @@ import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import org.springframework.web.servlet.view.InternalResourceViewResolver;
|
||||
import org.springframework.web.servlet.view.JstlView;
|
||||
import org.springframework.web.servlet.view.ResourceBundleViewResolver;
|
||||
import org.springframework.web.servlet.view.XmlViewResolver;
|
||||
import org.springframework.web.util.UrlPathHelper;
|
||||
import org.thymeleaf.spring4.SpringTemplateEngine;
|
||||
import org.thymeleaf.spring4.view.ThymeleafViewResolver;
|
||||
@@ -110,22 +107,6 @@ public class WebConfig implements WebMvcConfigurer {
|
||||
|
||||
return multipartResolver;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void extendMessageConverters(final List<HttpMessageConverter<?>> converters) {
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
sample.(class)=org.springframework.web.servlet.view.JstlView
|
||||
sample.url=/WEB-INF/view/sample.jsp
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd">
|
||||
|
||||
<bean id="sample" class="org.springframework.web.servlet.view.JstlView">
|
||||
<property name="url" value="/WEB-INF/view/sample.jsp" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user