Spring Framework UrlBasedViewResolver - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework UrlBasedViewResolver class.

This code example shows how to use the following methods:getPrefix, getSuffix, resolveViewName
	public ExtendedInternalResourceViewResolver() { 
		setContentType("text/html;charset=" + ResourceUtils.getProperty("app.encoding")); 
	} 
 
	public String getPrefix() { 
		return super.getPrefix(); 
	} 
 
	public String getSuffix() { 
		return super.getSuffix(); 
	} 
 
	public View resolveViewName(String viewName, Locale locale) throws Exception { 
		if (!viewName.startsWith("/")) { 
			viewName = "/" + viewName; 
		} 
		if (viewName.endsWith(getSuffix())) { 
			viewName = viewName.substring(0, viewName.length() - getSuffix().length()); 
		} 
		String path = getPrefix() + viewName + getSuffix(); 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setPrefix, setRedirectHttp10Compatible, setSuffix, setViewClass
@ComponentScan(basePackages={"uk.ac.ed.ph.qtiworks.web.controller.anonymous"}) 
public class AnonymousMvcConfiguration extends WebMvcConfigurerAdapter {
 
    @Bean 
    ViewResolver viewResolver() {
        final UrlBasedViewResolver result = new UrlBasedViewResolver();
        result.setRedirectHttp10Compatible(false);
        result.setViewClass(JstlView.class);
        result.setPrefix("/WEB-INF/jsp/views/anonymous/");
        result.setSuffix(".jsp");
        return result;
    } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setPrefix, setRedirectHttp10Compatible, setSuffix, setViewClass
@ComponentScan(basePackages={"uk.ac.ed.ph.qtiworks.web.controller.instructor"}) 
public class InstructorMvcConfiguration extends WebMvcConfigurerAdapter {
 
    @Bean 
    ViewResolver viewResolver() {
        final UrlBasedViewResolver result = new UrlBasedViewResolver();
        result.setRedirectHttp10Compatible(false);
        result.setViewClass(JstlView.class);
        result.setPrefix("/WEB-INF/jsp/views/instructor/");
        result.setSuffix(".jsp");
        return result;
    } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setPrefix, setSuffix, setViewClass
@ComponentScan("com.sprsec.controller") 
public class WebAppConfig { 
	 
	@Bean 
	public UrlBasedViewResolver setupViewResolver() {
		UrlBasedViewResolver resolver = new UrlBasedViewResolver();
		resolver.setPrefix("/WEB-INF/pages/");
		resolver.setSuffix(".jsp");
		resolver.setViewClass(JstlView.class);
		return resolver;
	} 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setPrefix, setRedirectHttp10Compatible, setSuffix, setViewClass
@ComponentScan(basePackages={"uk.ac.ed.ph.qtiworks.web.controller.legacy"}) 
public class LegacyAnonymousMvcConfiguration extends WebMvcConfigurerAdapter {
 
    @Bean 
    ViewResolver viewResolver() {
        final UrlBasedViewResolver result = new UrlBasedViewResolver();
        result.setRedirectHttp10Compatible(false);
        result.setViewClass(JstlView.class);
        result.setPrefix("/WEB-INF/jsp/views/anonymous/");
        result.setSuffix(".jsp");
        return result;
    } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setPrefix, setRedirectHttp10Compatible, setSuffix, setViewClass
@ComponentScan(basePackages={"uk.ac.ed.ph.qtiworks.web.lti", "uk.ac.ed.ph.qtiworks.web.controller.lti"}) 
public class LtiMvcConfiguration extends WebMvcConfigurerAdapter {
 
    @Bean 
    ViewResolver viewResolver() {
        final UrlBasedViewResolver result = new UrlBasedViewResolver();
        result.setRedirectHttp10Compatible(false);
        result.setViewClass(JstlView.class);
        result.setPrefix("/WEB-INF/jsp/views/lti/");
        result.setSuffix(".jsp");
        return result;
    } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setPrefix, setSuffix, setViewClass
@EnableWebMvc 
public class BaseTestConfig { 
	 
	@Bean 
	public UrlBasedViewResolver setupViewResolver() {
		UrlBasedViewResolver resolver = new UrlBasedViewResolver();
		resolver.setPrefix("/WEB-INF/pages/");
		resolver.setSuffix(".jsp");
		resolver.setViewClass(JstlView.class);
		return resolver;
	} 
 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setViewClass
@Configuration 
public class WebConfig extends WebMvcConfigurerAdapter {
 
    @Bean 
    public UrlBasedViewResolver urlBasedViewResolver() {
        UrlBasedViewResolver resolver = new UrlBasedViewResolver();
        resolver.setViewClass(JstlView.class);
        return resolver;
    } 
 
    @Bean 
    public WebController webController() { 
        return new WebController(); 
    } 
 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setViewClass
	@Inject 
	private ConnectionRepository connectionRepository;
 
	@Bean 
	public ViewResolver viewResolver() {
		UrlBasedViewResolver viewResolver = new UrlBasedViewResolver();
		viewResolver.setViewClass(TilesView.class);
		return viewResolver;
	} 
 
	@Bean 
	public TilesConfigurer tilesConfigurer() {
		TilesConfigurer configurer = new TilesConfigurer();
		configurer.setDefinitions(new String[] {
				"/WEB-INF/layouts/tiles.xml", 
				"/WEB-INF/views/**/tiles.xml"                            
		}); 
		configurer.setCheckRefresh(true);
		return configurer;
	} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setPrefix, setSuffix, setViewClass
@ComponentScan("de.blizzy.documentr") 
@ImportResource({ "classpath:/applicationContext-security.xml", "classpath:/applicationContext-cache.xml" }) 
public class ContextConfig extends WebMvcConfigurerAdapter implements SchedulingConfigurer {
	@Bean 
	public ViewResolver viewResolver() {
		UrlBasedViewResolver resolver = new UrlBasedViewResolver();
		resolver.setViewClass(JstlView.class);
		resolver.setPrefix("/WEB-INF/view"); //$NON-NLS-1$
		resolver.setSuffix(".jsp"); //$NON-NLS-1$
		return resolver;
	} 
 
	@Bean 
	public MessageSource messageSource() {
		ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
		messageSource.setFallbackToSystemLocale(false);
		messageSource.setCacheSeconds(10);
		messageSource.setBasenames(new String[] {
				"classpath:documentr_messages", "classpath:ValidationMessages" //$NON-NLS-1$ //$NON-NLS-2$ 
		}); 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Spring Framework UrlBasedViewResolver Methods: