Code example for WebMvcConfigurationSupport

Methods: requestMappingHandlerMapping

0
     * how to secure the service tier which helps mitigate bypassing of the URL based security too. 
     */ 
    @Bean 
    @Override 
    public RequestMappingHandlerMapping requestMappingHandlerMapping() { 
        RequestMappingHandlerMapping result = super.requestMappingHandlerMapping(); 
        result.setUseSuffixPatternMatch(false); 
        result.setUseTrailingSlashMatch(false); 
        return result; 
    } 
 
    @Override 
    protected void addResourceHandlers(ResourceHandlerRegistry registry) { 
        registry.addResourceHandler("/resources/**").addResourceLocations("/resources/").setCachePeriod(31556926); 
    } 
 
    @Bean 
    public ContentNegotiatingViewResolver contentNegotiatingViewResolver() { 
        ContentNegotiatingViewResolver result = new ContentNegotiatingViewResolver(); 
        Map<String, String> mediaTypes = new HashMap<String, String>();