Search in sources :

Example 41 with InternalResourceViewResolver

use of org.springframework.web.servlet.view.InternalResourceViewResolver in project spring-security-oauth by spring-projects.

the class WebMvcConfig method viewResolver.

@Bean
public ViewResolver viewResolver() {
    InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
    viewResolver.setPrefix("/WEB-INF/jsp/");
    viewResolver.setSuffix(".jsp");
    return viewResolver;
}
Also used : InternalResourceViewResolver(org.springframework.web.servlet.view.InternalResourceViewResolver) ContentNegotiationManagerFactoryBean(org.springframework.web.accept.ContentNegotiationManagerFactoryBean) Bean(org.springframework.context.annotation.Bean) ConversionServiceFactoryBean(org.springframework.context.support.ConversionServiceFactoryBean)

Example 42 with InternalResourceViewResolver

use of org.springframework.web.servlet.view.InternalResourceViewResolver in project Logos_Materials_October_2017 by VolodymyrZavada.

the class MvcConfig method configureViewResolvers.

@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
    InternalResourceViewResolver resolver = new InternalResourceViewResolver();
    resolver.setPrefix("/WEB-INF/views/");
    resolver.setSuffix(".jsp");
    resolver.setViewClass(JstlView.class);
    registry.viewResolver(resolver);
}
Also used : InternalResourceViewResolver(org.springframework.web.servlet.view.InternalResourceViewResolver)

Example 43 with InternalResourceViewResolver

use of org.springframework.web.servlet.view.InternalResourceViewResolver in project nikita-noark5-core by HiOA-ABI.

the class AppWebMvcConfiguration method getViewResolver.

/**
      * Used to set a suffix for the thymelaf templates under resources. All content will be under webapp
      * so we can use webapp as a suffix (even though I don't use it right now.)
      * Set a suffix (.html, .jsp etc) that all the files have to use.
      * The point of this is to make the (view) code generating html pages easier to read as we can ignore
      * prefixes and suffixes in code.
     */
@Bean
public ViewResolver getViewResolver() {
    InternalResourceViewResolver resolver = new InternalResourceViewResolver();
    //resolver.setPrefix("webapp/");
    resolver.setSuffix(".html");
    return resolver;
}
Also used : InternalResourceViewResolver(org.springframework.web.servlet.view.InternalResourceViewResolver) Bean(org.springframework.context.annotation.Bean)

Example 44 with InternalResourceViewResolver

use of org.springframework.web.servlet.view.InternalResourceViewResolver in project steve by RWTH-i5-IDSG.

the class BeanConfiguration method urlBasedViewResolver.

// -------------------------------------------------------------------------
// Web config
// -------------------------------------------------------------------------
/**
 * Resolver for JSP views/templates. Controller classes process the requests
 * and forward to JSP files for rendering.
 */
@Bean
public InternalResourceViewResolver urlBasedViewResolver() {
    InternalResourceViewResolver resolver = new InternalResourceViewResolver();
    resolver.setPrefix("/WEB-INF/views/");
    resolver.setSuffix(".jsp");
    return resolver;
}
Also used : InternalResourceViewResolver(org.springframework.web.servlet.view.InternalResourceViewResolver) LocalValidatorFactoryBean(org.springframework.validation.beanvalidation.LocalValidatorFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 45 with InternalResourceViewResolver

use of org.springframework.web.servlet.view.InternalResourceViewResolver in project spring-boot by spring-projects.

the class WebConfig method viewResolver.

@Bean
public InternalResourceViewResolver viewResolver() {
    InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
    viewResolver.setPrefix("/WEB-INF/views/");
    viewResolver.setSuffix(".jsp");
    return viewResolver;
}
Also used : InternalResourceViewResolver(org.springframework.web.servlet.view.InternalResourceViewResolver) Bean(org.springframework.context.annotation.Bean)

Aggregations

InternalResourceViewResolver (org.springframework.web.servlet.view.InternalResourceViewResolver)65 Bean (org.springframework.context.annotation.Bean)47 Test (org.junit.jupiter.api.Test)8 ContentNegotiatingViewResolver (org.springframework.web.servlet.view.ContentNegotiatingViewResolver)5 ArrayList (java.util.ArrayList)4 MappingJackson2JsonView (org.springframework.web.servlet.view.json.MappingJackson2JsonView)4 Test (org.junit.Test)3 Jaxb2Marshaller (org.springframework.oxm.jaxb.Jaxb2Marshaller)3 ContentNegotiationManager (org.springframework.web.accept.ContentNegotiationManager)3 FixedContentNegotiationStrategy (org.springframework.web.accept.FixedContentNegotiationStrategy)3 HeaderContentNegotiationStrategy (org.springframework.web.accept.HeaderContentNegotiationStrategy)3 View (org.springframework.web.servlet.View)3 MarshallingView (org.springframework.web.servlet.view.xml.MarshallingView)3 Before (org.junit.Before)2 Order (org.springframework.core.annotation.Order)2 WebTestClient (org.springframework.test.web.reactive.server.WebTestClient)2 MockMvc (org.springframework.test.web.servlet.MockMvc)2 MockMvcWebTestClient (org.springframework.test.web.servlet.client.MockMvcWebTestClient)2 ContentNegotiationManagerFactoryBean (org.springframework.web.accept.ContentNegotiationManagerFactoryBean)2 ViewResolverComposite (org.springframework.web.servlet.view.ViewResolverComposite)2