Spring Framework ContentNegotiationManager - 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 ContentNegotiationManager class.

This code example shows how to use the following methods:
		context.registerSingleton("velocityConfigurer", VelocityConfigurer.class);
		context.registerSingleton("tilesConfigurer", TilesConfigurer.class);
		context.registerSingleton("groovyMarkupConfigurer", GroovyMarkupConfigurer.class);
		this.registry = new ViewResolverRegistry();
		this.registry.setApplicationContext(context);
		this.registry.setContentNegotiationManager(new ContentNegotiationManager());
	} 
 
 
	@Test
	public void order() { 
		assertEquals(Ordered.LOWEST_PRECEDENCE, this.registry.getOrder());
		this.registry.enableContentNegotiation();
		assertEquals(Ordered.HIGHEST_PRECEDENCE, this.registry.getOrder());
	} 
 
	@Test
	public void hasRegistrations() { 
		assertFalse(this.registry.hasRegistrations());
		this.registry.velocity();
6
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
This code example shows how to use the following methods:
 
	private boolean useRegisteredSuffixPatternMatch = false; 
 
	private boolean useTrailingSlashMatch = true; 
 
	private ContentNegotiationManager contentNegotiationManager = new ContentNegotiationManager(); 
 
	private final List<String> fileExtensions = new ArrayList<String>(); 
 
	private StringValueResolver embeddedValueResolver; 
 
 
	/** 
	 * Whether to use suffix pattern match (".*") when matching patterns to 
	 * requests. If enabled a method mapped to "/users" also matches to "/users.*". 
	 * <p>The default value is {@code true}. 
	 * <p>Also see {@link #setUseRegisteredSuffixPatternMatch(boolean)} for 
	 * more fine-grained control over specific suffixes to allow. 
	 */ 
	public void setUseSuffixPatternMatch(boolean useSuffixPatternMatch) { 
5
CodeRank
This code example shows how to use the following methods:
        return this.contentNegotiationManager; 
    } 
 
    public void setContentNegotiationManager(ContentNegotiationManager contentNegotiationManager) { 
        this.contentNegotiationManager = contentNegotiationManager != null 
                ? contentNegotiationManager : new ContentNegotiationManager(); 
    } 
 
    public MediaType getDefaultContentType() { 
        return defaultContentType; 
    } 
 
    public void setDefaultContentType(MediaType defaultContentType) { 
        this.defaultContentType = defaultContentType; 
    } 
 
    public Map<Class<? extends Exception>, RestExceptionHandler> getExceptionHandlers() { 
        return handlers; 
    } 
 
3
CodeRank