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

This code example shows how to use the following methods:setAlwaysUseFullPath, setUrlDecode
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        if (bean instanceof RequestMappingHandlerMapping) {
            RequestMappingHandlerMapping requestMappingHandlerMapping = (RequestMappingHandlerMapping) bean;
 
            // URL decode after request mapping, not before. 
            requestMappingHandlerMapping.setUrlDecode(false);
 
            // Workaround to make the previous fix work. See https://jira.springsource.org/browse/SPR-11101. 
            requestMappingHandlerMapping.setAlwaysUseFullPath(true);
 
        } 
 
        return bean;
    } 
 
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        return bean;
    } 
 
    public int getOrder() { 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setContentNegotiationManager, setUseRegisteredSuffixPatternMatch, setUseSuffixPatternMatch, setUseTrailingSlashMatch, setAlwaysUseFullPath
public class WebConfiguration extends WebMvcConfigurationSupport { 
 
  @Bean 
  public RequestMappingHandlerMapping requestMappingHandlerMapping() { 
    RequestMappingHandlerMapping handlerMapping = super.requestMappingHandlerMapping(); 
    handlerMapping.setAlwaysUseFullPath(true); 
    return handlerMapping; 
  } 
} 

4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getHandlerMethods
        this.handlerMapping = handlerMapping;
    } 
 
    @Override 
    public void initWith(ApplicationContext parentContext) {
        iterator = handlerMapping.getHandlerMethods().entrySet().iterator();
        this.parentContext = parentContext;
    } 
 
    @Override 
    public boolean hasNext() { 
        return iterator.hasNext();
    } 
 
    @Override 
    public MethodContext next() { 
        final Map.Entry<RequestMappingInfo, HandlerMethod> next = iterator.next();
        return new SpringMethodContext(parentContext, next.getKey(), next.getValue());
    } 
 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setContentNegotiationManager, setUseRegisteredSuffixPatternMatch, setUseSuffixPatternMatch, setUseTrailingSlashMatch, setInterceptors
    @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>(); 
        mediaTypes.put("json", MediaType.APPLICATION_JSON_VALUE); 
        result.setMediaTypes(mediaTypes); 

4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setContentNegotiationManager, setUseRegisteredSuffixPatternMatch, setUseSuffixPatternMatch, setUseTrailingSlashMatch, setInterceptors
	} 
 
	@Override 
	public RequestMappingHandlerMapping requestMappingHandlerMapping() { 
		RequestMappingHandlerMapping rm = super.requestMappingHandlerMapping(); 
		rm.setUseSuffixPatternMatch(false); 
		return rm; 
	} 
 
} 

4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
	 
 
	@Bean 
	public RequestMappingHandlerMapping handlerMapping() throws Exception { 
 
		 RequestMappingHandlerMapping mapping = new  RequestMappingHandlerMapping(); 
		return mapping; 
	} 
	 
	@Bean 
	public RequestMappingHandlerAdapter handlerAdapter() throws Exception { 
 
		RequestMappingHandlerAdapter mapping = new RequestMappingHandlerAdapter(); 
 
		return mapping; 
 
	} 
 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
/** 
 * Extends RequestMappingHandlerMapping to provide a custom {@link RolesRequestCondition}. 
 *  
 * Plugged in via {@link WebConfig#requestMappingHandlerMapping()}. 
 */ 
public class ExtendedRequestMappingHandlerMapping extends RequestMappingHandlerMapping { 
 
	@Override 
	protected RequestCondition<?> getCustomTypeCondition(Class<?> handlerType) { 
		RoleMapping typeAnnotation = AnnotationUtils.findAnnotation(handlerType, RoleMapping.class); 
		return createCondition(typeAnnotation); 
	} 
 
	@Override 
	protected RequestCondition<?> getCustomMethodCondition(Method method) { 
		RoleMapping methodAnnotation = AnnotationUtils.findAnnotation(method, RoleMapping.class); 
		return createCondition(methodAnnotation); 
	} 
 
	private RequestCondition<?> createCondition(RoleMapping accessMapping) { 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Spring Framework RequestMappingHandlerMapping Methods: