Java Code Examples for org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#setUseSuffixPatternMatch()

The following examples show how to use org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#setUseSuffixPatternMatch() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WebMvcConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
/**
 * We mention this in the book, but this helps to ensure that the intercept-url patterns prevent access to our
 * controllers. For example, once security has been applied for administrators try commenting out the modifications
 * to the super class and requesting <a
 * href="http://localhost:800/calendar/events/.html">http://localhost:800/calendar/events/.html</a>. You will
 * observe that security is bypassed since it did not match the pattern we provided. In later chapters, we discuss
 * how to secure the service tier which helps mitigate bypassing of the URL based security too.
 */
// FIXME: FInd out what this is and why it is here.
@Bean
public RequestMappingHandlerMapping requestMappingHandlerMapping() {
    RequestMappingHandlerMapping result = new RequestMappingHandlerMapping();
    result.setUseSuffixPatternMatch(false);
    result.setUseTrailingSlashMatch(false);
    return result;
}
 
Example 2
Source File: DispatcherServletConfiguration.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Override
protected RequestMappingHandlerMapping createRequestMappingHandlerMapping() {
    LOGGER.debug("Creating requestMappingHandlerMapping");
    RequestMappingHandlerMapping requestMappingHandlerMapping = new RequestMappingHandlerMapping();
    requestMappingHandlerMapping.setUseSuffixPatternMatch(false);
    return requestMappingHandlerMapping;
}
 
Example 3
Source File: DispatcherServletConfiguration.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Override
protected RequestMappingHandlerMapping createRequestMappingHandlerMapping() {
    LOGGER.debug("Creating requestMappingHandlerMapping");
    RequestMappingHandlerMapping requestMappingHandlerMapping = new RequestMappingHandlerMapping();
    requestMappingHandlerMapping.setUseSuffixPatternMatch(false);
    return requestMappingHandlerMapping;
}
 
Example 4
Source File: DispatcherServletConfiguration.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Override
public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
    LOGGER.debug("Creating requestMappingHandlerMapping");
    RequestMappingHandlerMapping requestMappingHandlerMapping = new RequestMappingHandlerMapping();
    requestMappingHandlerMapping.setUseSuffixPatternMatch(false);
    Object[] interceptors = {localeChangeInterceptor()};
    requestMappingHandlerMapping.setInterceptors(interceptors);
    return requestMappingHandlerMapping;
}
 
Example 5
Source File: DispatcherServletConfiguration.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Override
protected RequestMappingHandlerMapping createRequestMappingHandlerMapping() {
    LOGGER.debug("Creating requestMappingHandlerMapping");
    RequestMappingHandlerMapping requestMappingHandlerMapping = new RequestMappingHandlerMapping();
    requestMappingHandlerMapping.setUseSuffixPatternMatch(false);
    return requestMappingHandlerMapping;
}
 
Example 6
Source File: AppDispatcherServletConfiguration.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Override
public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
    LOGGER.debug("Creating requestMappingHandlerMapping");
    RequestMappingHandlerMapping requestMappingHandlerMapping = new RequestMappingHandlerMapping();
    requestMappingHandlerMapping.setUseSuffixPatternMatch(false);
    requestMappingHandlerMapping.setRemoveSemicolonContent(false);
    Object[] interceptors = { localeChangeInterceptor() };
    requestMappingHandlerMapping.setInterceptors(interceptors);
    return requestMappingHandlerMapping;
}
 
Example 7
Source File: ApiDispatcherServletConfiguration.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Override
protected RequestMappingHandlerMapping createRequestMappingHandlerMapping() {
    RequestMappingHandlerMapping requestMappingHandlerMapping = new RequestMappingHandlerMapping();
    requestMappingHandlerMapping.setUseSuffixPatternMatch(false);
    requestMappingHandlerMapping.setRemoveSemicolonContent(false);
    return requestMappingHandlerMapping;
}
 
Example 8
Source File: WebMvcConfig.java    From maven-framework-project with MIT License 5 votes vote down vote up
/**
 * We mention this in the book, but this helps to ensure that the intercept-url patterns prevent access to our
 * controllers. For example, once security has been applied for administrators try commenting out the modifications
 * to the super class and requesting <a
 * href="http://localhost:800/calendar/events/.html">http://localhost:800/calendar/events/.html</a>. You will
 * observe that security is bypassed since it did not match the pattern we provided. In later chapters, we discuss
 * 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;
}
 
Example 9
Source File: WebMvcConfigurationSupport.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Return a {@link RequestMappingHandlerMapping} ordered at 0 for mapping
 * requests to annotated controllers.
 */
@Bean
public RequestMappingHandlerMapping requestMappingHandlerMapping() {
	RequestMappingHandlerMapping handlerMapping = createRequestMappingHandlerMapping();
	handlerMapping.setOrder(0);
	handlerMapping.setInterceptors(getInterceptors());
	handlerMapping.setContentNegotiationManager(mvcContentNegotiationManager());
	handlerMapping.setCorsConfigurations(getCorsConfigurations());

	PathMatchConfigurer configurer = getPathMatchConfigurer();
	if (configurer.isUseSuffixPatternMatch() != null) {
		handlerMapping.setUseSuffixPatternMatch(configurer.isUseSuffixPatternMatch());
	}
	if (configurer.isUseRegisteredSuffixPatternMatch() != null) {
		handlerMapping.setUseRegisteredSuffixPatternMatch(configurer.isUseRegisteredSuffixPatternMatch());
	}
	if (configurer.isUseTrailingSlashMatch() != null) {
		handlerMapping.setUseTrailingSlashMatch(configurer.isUseTrailingSlashMatch());
	}
	if (configurer.getPathMatcher() != null) {
		handlerMapping.setPathMatcher(configurer.getPathMatcher());
	}
	if (configurer.getUrlPathHelper() != null) {
		handlerMapping.setUrlPathHelper(configurer.getUrlPathHelper());
	}

	return handlerMapping;
}
 
Example 10
Source File: WebMvcConfig.java    From maven-framework-project with MIT License 5 votes vote down vote up
/**
 * We mention this in the book, but this helps to ensure that the intercept-url patterns prevent access to our
 * controllers. For example, once security has been applied for administrators try commenting out the modifications
 * to the super class and requesting <a
 * href="http://localhost:800/calendar/events/.html">http://localhost:800/calendar/events/.html</a>. You will
 * observe that security is bypassed since it did not match the pattern we provided. In later chapters, we discuss
 * 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;
}
 
Example 11
Source File: WebMvcConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
/**
 * We mention this in the book, but this helps to ensure that the intercept-url patterns prevent access to our
 * controllers. For example, once security has been applied for administrators try commenting out the modifications
 * to the super class and requesting <a
 * href="http://localhost:800/calendar/events/.html">http://localhost:800/calendar/events/.html</a>. You will
 * observe that security is bypassed since it did not match the pattern we provided. In later chapters, we discuss
 * how to secure the service tier which helps mitigate bypassing of the URL based security too.
 */
// FIXME: FInd out what this is and why it is here.
@Bean
public RequestMappingHandlerMapping requestMappingHandlerMapping() {
    RequestMappingHandlerMapping result = new RequestMappingHandlerMapping();
    result.setUseSuffixPatternMatch(false);
    result.setUseTrailingSlashMatch(false);
    return result;
}
 
Example 12
Source File: DispatcherServletConfiguration.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Override
protected RequestMappingHandlerMapping createRequestMappingHandlerMapping() {
    LOGGER.debug("Creating requestMappingHandlerMapping");
    RequestMappingHandlerMapping requestMappingHandlerMapping = new RequestMappingHandlerMapping();
    requestMappingHandlerMapping.setUseSuffixPatternMatch(false);
    return requestMappingHandlerMapping;
}
 
Example 13
Source File: WebMvcConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
/**
 * We mention this in the book, but this helps to ensure that the intercept-url patterns prevent access to our
 * controllers. For example, once security has been applied for administrators try commenting out the modifications
 * to the super class and requesting <a
 * href="http://localhost:800/calendar/events/.html">http://localhost:800/calendar/events/.html</a>. You will
 * observe that security is bypassed since it did not match the pattern we provided. In later chapters, we discuss
 * how to secure the service tier which helps mitigate bypassing of the URL based security too.
 */
// FIXME: FInd out what this is and why it is here.
@Bean
public RequestMappingHandlerMapping requestMappingHandlerMapping() {
    RequestMappingHandlerMapping result = new RequestMappingHandlerMapping();
    result.setUseSuffixPatternMatch(false);
    result.setUseTrailingSlashMatch(false);
    return result;
}
 
Example 14
Source File: WebMvcConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
/**
 * We mention this in the book, but this helps to ensure that the intercept-url patterns prevent access to our
 * controllers. For example, once security has been applied for administrators try commenting out the modifications
 * to the super class and requesting <a
 * href="http://localhost:800/calendar/events/.html">http://localhost:800/calendar/events/.html</a>. You will
 * observe that security is bypassed since it did not match the pattern we provided. In later chapters, we discuss
 * how to secure the service tier which helps mitigate bypassing of the URL based security too.
 */
// FIXME: FInd out what this is and why it is here.
@Bean
public RequestMappingHandlerMapping requestMappingHandlerMapping() {
    RequestMappingHandlerMapping result = new RequestMappingHandlerMapping();
    result.setUseSuffixPatternMatch(false);
    result.setUseTrailingSlashMatch(false);
    return result;
}
 
Example 15
Source File: WebMvcConfig.java    From Spring-Security-Third-Edition with MIT License 5 votes vote down vote up
/**
 * We mention this in the book, but this helps to ensure that the intercept-url patterns prevent access to our
 * controllers. For example, once security has been applied for administrators try commenting out the modifications
 * to the super class and requesting <a
 * href="http://localhost:800/calendar/events/.html">http://localhost:800/calendar/events/.html</a>. You will
 * observe that security is bypassed since it did not match the pattern we provided. In later chapters, we discuss
 * how to secure the service tier which helps mitigate bypassing of the URL based security too.
 */
// FIXME: FInd out what this is and why it is here.
@Bean
public RequestMappingHandlerMapping requestMappingHandlerMapping() {
    RequestMappingHandlerMapping result = new RequestMappingHandlerMapping();
    result.setUseSuffixPatternMatch(false);
    result.setUseTrailingSlashMatch(false);
    return result;
}
 
Example 16
Source File: WebMvcConfigurationSupport.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return a {@link RequestMappingHandlerMapping} ordered at 0 for mapping
 * requests to annotated controllers.
 */
@Bean
public RequestMappingHandlerMapping requestMappingHandlerMapping() {
	RequestMappingHandlerMapping mapping = createRequestMappingHandlerMapping();
	mapping.setOrder(0);
	mapping.setInterceptors(getInterceptors());
	mapping.setContentNegotiationManager(mvcContentNegotiationManager());
	mapping.setCorsConfigurations(getCorsConfigurations());

	PathMatchConfigurer configurer = getPathMatchConfigurer();
	if (configurer.isUseSuffixPatternMatch() != null) {
		mapping.setUseSuffixPatternMatch(configurer.isUseSuffixPatternMatch());
	}
	if (configurer.isUseRegisteredSuffixPatternMatch() != null) {
		mapping.setUseRegisteredSuffixPatternMatch(configurer.isUseRegisteredSuffixPatternMatch());
	}
	if (configurer.isUseTrailingSlashMatch() != null) {
		mapping.setUseTrailingSlashMatch(configurer.isUseTrailingSlashMatch());
	}
	UrlPathHelper pathHelper = configurer.getUrlPathHelper();
	if (pathHelper != null) {
		mapping.setUrlPathHelper(pathHelper);
	}
	PathMatcher pathMatcher = configurer.getPathMatcher();
	if (pathMatcher != null) {
		mapping.setPathMatcher(pathMatcher);
	}

	return mapping;
}
 
Example 17
Source File: StandaloneMockMvcBuilder.java    From java-technology-stack with MIT License 5 votes vote down vote up
public RequestMappingHandlerMapping getHandlerMapping() {
	RequestMappingHandlerMapping handlerMapping = handlerMappingFactory.get();
	handlerMapping.setEmbeddedValueResolver(new StaticStringValueResolver(placeholderValues));
	handlerMapping.setUseSuffixPatternMatch(useSuffixPatternMatch);
	handlerMapping.setUseTrailingSlashMatch(useTrailingSlashPatternMatch);
	handlerMapping.setOrder(0);
	handlerMapping.setInterceptors(getInterceptors());
	if (removeSemicolonContent != null) {
		handlerMapping.setRemoveSemicolonContent(removeSemicolonContent);
	}
	return handlerMapping;
}
 
Example 18
Source File: SpringMvcConfiguration.java    From chassis with Apache License 2.0 5 votes vote down vote up
/**
 * Return a {@link RequestMappingHandlerMapping} ordered at 0 for mapping
 * requests to annotated controllers.
 */
@Bean
@Override
public RequestMappingHandlerMapping requestMappingHandlerMapping() {
    PathMatchConfigurer configurer = new PathMatchConfigurer();
    configurePathMatch(configurer);
    RequestMappingHandlerMapping handlerMapping = new RequestMappingHandlerMapping();
    handlerMapping.setOrder(0);
    handlerMapping.setDetectHandlerMethodsInAncestorContexts(true);
    handlerMapping.setInterceptors(getInterceptors());
    handlerMapping.setContentNegotiationManager(mvcContentNegotiationManager());
    if (configurer.isUseSuffixPatternMatch() != null) {
        handlerMapping.setUseSuffixPatternMatch(configurer.isUseSuffixPatternMatch());
    }
    if (configurer.isUseRegisteredSuffixPatternMatch() != null) {
        handlerMapping.setUseRegisteredSuffixPatternMatch(configurer.isUseRegisteredSuffixPatternMatch());
    }
    if (configurer.isUseTrailingSlashMatch() != null) {
        handlerMapping.setUseTrailingSlashMatch(configurer.isUseTrailingSlashMatch());
    }
    if (configurer.getPathMatcher() != null) {
        handlerMapping.setPathMatcher(configurer.getPathMatcher());
    }
    if (configurer.getUrlPathHelper() != null) {
        handlerMapping.setUrlPathHelper(configurer.getUrlPathHelper());
    }
    return handlerMapping;
}
 
Example 19
Source File: StandaloneMockMvcBuilder.java    From spring-analysis-note with MIT License 5 votes vote down vote up
public RequestMappingHandlerMapping getHandlerMapping(
		FormattingConversionService mvcConversionService,
		ResourceUrlProvider mvcResourceUrlProvider) {
	RequestMappingHandlerMapping handlerMapping = handlerMappingFactory.get();
	handlerMapping.setEmbeddedValueResolver(new StaticStringValueResolver(placeholderValues));
	handlerMapping.setUseSuffixPatternMatch(useSuffixPatternMatch);
	handlerMapping.setUseTrailingSlashMatch(useTrailingSlashPatternMatch);
	handlerMapping.setOrder(0);
	handlerMapping.setInterceptors(getInterceptors(mvcConversionService, mvcResourceUrlProvider));
	if (removeSemicolonContent != null) {
		handlerMapping.setRemoveSemicolonContent(removeSemicolonContent);
	}
	return handlerMapping;
}
 
Example 20
Source File: WebMvcConfigurationSupport.java    From spring-analysis-note with MIT License 4 votes vote down vote up
/**
 * Return a {@link RequestMappingHandlerMapping} ordered at 0 for mapping
 * requests to annotated controllers.
 */
@Bean
public RequestMappingHandlerMapping requestMappingHandlerMapping(
		ContentNegotiationManager mvcContentNegotiationManager,
		FormattingConversionService mvcConversionService,
		ResourceUrlProvider mvcResourceUrlProvider) {
	RequestMappingHandlerMapping mapping = createRequestMappingHandlerMapping();
	mapping.setOrder(0);
	mapping.setInterceptors(getInterceptors(mvcConversionService, mvcResourceUrlProvider));
	mapping.setContentNegotiationManager(mvcContentNegotiationManager);
	mapping.setCorsConfigurations(getCorsConfigurations());

	PathMatchConfigurer configurer = getPathMatchConfigurer();

	Boolean useSuffixPatternMatch = configurer.isUseSuffixPatternMatch();
	if (useSuffixPatternMatch != null) {
		mapping.setUseSuffixPatternMatch(useSuffixPatternMatch);
	}
	Boolean useRegisteredSuffixPatternMatch = configurer.isUseRegisteredSuffixPatternMatch();
	if (useRegisteredSuffixPatternMatch != null) {
		mapping.setUseRegisteredSuffixPatternMatch(useRegisteredSuffixPatternMatch);
	}
	Boolean useTrailingSlashMatch = configurer.isUseTrailingSlashMatch();
	if (useTrailingSlashMatch != null) {
		mapping.setUseTrailingSlashMatch(useTrailingSlashMatch);
	}

	UrlPathHelper pathHelper = configurer.getUrlPathHelper();
	if (pathHelper != null) {
		mapping.setUrlPathHelper(pathHelper);
	}
	PathMatcher pathMatcher = configurer.getPathMatcher();
	if (pathMatcher != null) {
		mapping.setPathMatcher(pathMatcher);
	}
	Map<String, Predicate<Class<?>>> pathPrefixes = configurer.getPathPrefixes();
	if (pathPrefixes != null) {
		mapping.setPathPrefixes(pathPrefixes);
	}

	return mapping;
}